Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change text on NotifyIcon Context Menu

Status
Not open for further replies.

andrewwatson

Programmer
Jul 16, 2002
10
GB
I've got a NotifyIcon with a context menu. I want one of the menu items to change its own text:

Code:
private void mnuItem_Click (object sender,System.EventArgs e)
{
    if (mnuItem.Text=="Do Something")
    {
        // Do something       
        mnuItem.Text="Do Something Else";
    }
    else
    {
        // Do something else
        mnuItem.Text="Do Something";
    }
}

When I select the menu item, it does what it's supposed to, but when I open the menu again, it's still displaying the old text. However, selecting the item again carries out the alternate action, as if the text had been changed!

Do I need to call something to notify the system that the menu's changed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top