andrewwatson
Programmer
I've got a NotifyIcon with a context menu. I want one of the menu items to change its own text:
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?
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?