I've got a pretty standard menu at the top of my main form, and the
MenuItem's have event handlers for the "Select" event to update the
statusbar text, but what I can't seem to find is a way to know when the user
has cancelled the menu without clicking anything so I can clear the
statusbar text.
I feel like I'm missing something obvious. Does anyone know how to do this?
Thanks!
Terry
Jakob Christensen - 15 Aug 2005 09:13 GMT
All your menu items (including the main menu) must use the same event handler
for the Select event. In the event handler you can put code similar to the
following code:
private void menuItem_Select(object sender, System.EventArgs e)
{
if (sender == menuItem2)
this.statusBar1.Panels[0].Text = "Menu 2";
else if (sender == menuItem3)
this.statusBar1.Panels[0].Text = "Menu 3";
else
this.statusBar1.Panels[0].Text = "Ready";
}
When the user cancels the menu the statusbar will show the text "Ready".
HTH, Jakob.

Signature
http://www.dotninjas.dk
http://www.powerbytes.dk
> I've got a pretty standard menu at the top of my main form, and the
> MenuItem's have event handlers for the "Select" event to update the
[quoted text clipped - 6 lines]
> Thanks!
> Terry
Marcus - 15 Aug 2005 13:42 GMT
Terry,
Check out the MenuStart/MenuComplete events of your form.
- Marcus
> I've got a pretty standard menu at the top of my main form, and the
> MenuItem's have event handlers for the "Select" event to update the
[quoted text clipped - 6 lines]
> Thanks!
> Terry
Terry - 15 Aug 2005 15:49 GMT
> Terry,
> Check out the MenuStart/MenuComplete events of your form.
[quoted text clipped - 12 lines]
>> Thanks!
>> Terry
Ah! Thank you! That's exactly what I was looking for.