The code first creates a ToolStripMenuItem, passing the constructor the string it should display. It then:
Sets the item's name
Sets the item's ShortcutKeys property to the 1 key plus the Control key so it is activated when the user presses Ctrl+1
Adds the mnuTool1_Click event handler to the item's Click event handler
The code then adds the new item to the mnuTools top-level menu item created at design time.
The program repeats these steps for a second menu item, this time passing the ToolStripMenuItem constructor a string and image so the menu item displays both text and a picture.
The following code shows the mnuTool1_Click event handler. The mnuTool2_Click event handler is similar.
Comments