Menu Bar
Menu Bar
To start adding menu items to your application, open an existing project or start a
new project, then click on Tools in the menu bar of the Visual Basic IDE and select
Menu Editor. When you click on the Menu Editor, the Menu Editor dialog will appear.
In the Menu Editor dialog , key in the first item File in the caption text box. You can
use the ampersand ( & ) sign in front of F so that F will be underlined when it
appears in the menu, and F will become the hot key to initiate the action under this
item by pressing the Alt key and the letter F. After typing &File in the Caption text
box, move to the name textbox to enter the name for this menu item, you can type
in mnuFile here. Now, click the Next button and the menu item &File will move into
the empty space below, as shown in the following diagram:
Figure1
You can then add in other menu items on the menu bar by following the same
procedure, as shown in the diagram below:
Figure2
when you click Ok, the menu items will be shown on the menu bar of the form.
Figure 3
Now, you may proceed to add the sub menus. In the Menu Editor, click on the Insert
button between File and Exit and then click the right arrow key, and the dotted line
will appear. This shows the second level of the menu, or the submenu. Now key in
the caption and the name. Repeat the same procedure to add other submenu items.
Here, we are adding New, Open, Save, Save As and Exit.
Figure 4
Now click the OK button and go back to your form. You can see the dropped down
submenus when you click on the item File, as shown.
Figure 5