Visual Basic 6 allows us to add menu bar to the form. You can add your own menu bar to the form and write code to make it work.
In this article, we will add a menu bar to a VB 6 form.
To add a form, go to Tools > select Menu Editor
Once you have clicked the Menu Editor, you will see the following Menu Editor window.
Write a caption for your menu and a name, you can also select an index value which determines the order of the menu. Therefore, least the number, higher the order.
You must click Insert to add your menu item or you can delete an item.
There are four arrows at the bottom left side which indicate the position of the current menu item. You can move an item – up, down, left, and right
. Moving up or down will change the order of the menu item. If you move an item right, it will become a sub-menu item for an item(File) above it.
From the above figure, you can see that the File is a top level menu item and Open/Close are sub-menu items. The open
and close
are move to right for making them as sub-menu item.
Output : Menu Bar
The File menu will appear with two sub-menu items open and close as shown in above figure.