Creating Menu in Visual Basic .NET

In this example, we will see how to create the Menu in VB.NET
You can drag a MenuStrip control from the ToolBox drop it on the Form
Now you can type on the Menu and you can create sub menu or menu with same level. Creating menu in designer mode is very straight forward

Following figure shows the menu creation in design mode

Now you can change the properties of a menu using the property window

To add short cut for menu you can use ShortCutKeys property of the menu. I have crated a ShortCut here Ctrl+Shift+O for menu item Open

You can use this property windows to add image, add check box to the menu

Fowling figure shows a Form added simple menu system. This is in run time

This is the code for click events of the menu

Code explanation

  • Line 3: Click event handler of the New menu is to display a Message Box
  • Line 8: Click event handler of the New menu is to display the CheckBox

Leave a Reply

Your email address will not be published. Required fields are marked *