VB.NET Menu Control
A menu is used as a menu bar in the Windows form that contains a list of related commands, and it is implemented through MenuStrip Control. The Menu control is also known as the VB.NET MenuStrip Control. The menu items are created with ToolStripMenuItem Objects. Furthermore, the ToolStripDropDownMenu and ToolStripMenuItem objects enable full control over the structure, appearance, functionalities to create menu items, submenus, and drop-down menus in a VB.NET application.
Let's create a MenuBar by dragging a MenuStrip control from the toolbox and dropping it to the Windows form.
Step 1. Drag the MenuStrip control from the toolbox and drop it on to the Form.
Step 2: Once the MenuStrip is added to the form, we can set various properties of the Menu by clicking on the MenuStrip control.
Properties of the MenuStrip Control
There are following properties of the VB.NET MenuStrip control.
Methods of the MenuStrip Control
Events of the MenuStrip Control
Let's create a program to display the menu bar in the Windows form.
In this image, we have created the menu and sub-items of the menu bar in the form.
Now, we write the Shortcut keys for the File subitems, such as New -> Ctrl + N, Open -> Ctrl + O, etc.
After that, we can see the subitems of the Files with their Shortcut keys, as shown below.
Click on the File menu that shows the multiple options related to files.