CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Location
    AZ
    Posts
    201

    Problem changing menu text

    I have an application that uses a notify icon. When the user right clicks I display a context menu. One of the menu item's text should be toggled between two text items each time it is clicked. The menu item Click method has the following code:

    timerActive = !timerActive;
    menuStartStopTimer.Text = timerActive ? "&Stop Timer" : "&Start Timer";

    I have verified (by setting a breakpoint) that the method does set the correct text but it always displays the initial setting. How do I get the text to change?

    Thanks in advance,
    Hal
    up·grade (up'gräd'),
    to take out old bugs
    and put in new ones.

  2. #2
    Join Date
    Feb 2001
    Location
    AZ
    Posts
    201
    Additional information:

    If I change the text before the context menu is displayed, the menu shows the changed text. Once the menu is displayed, the text won't change.

    Regards,
    Hal
    up·grade (up'gräd'),
    to take out old bugs
    and put in new ones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured