I'm using a ToolStrip control as a menu on a form. I have configured it with the Items Collection Editor. It seems that events cannot be configured in the Items Collection Editor. The ToolStrip itself has the Click
and the ItemClicked
events.
My menu contains a DropDownButton Tools
. Tools
contains a MenuItem Config
. I need an event fired when I click Config
.
The events Click
and ItemClicked
are just fired when I click Tools
but not when I click the MenuItem Config
.
I have not found any help on this simple task. Probably it's too simple to be discussed.
Can anyone give me a hint, please?
To generate the event handler using the designer, you may follow these steps:
MenuItem
.Here's a demo:
Alternatively, you may create the event handler yourself using code. For example, add this line to your form constructor:
toolStripMenuItem1.Click += ToolStripMenuItem1_Click;