VB 6 Adding Menu Bar To Form

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.

Advertisements

In this article, we will add a menu bar to a VB 6 form.

To add a form, go to Tools > select Menu Editor

Open Menu Editor under Tools
Open Menu Editor under Tools

Once you have clicked the Menu Editor, you will see the following Menu Editor window.

Menu Editor
Menu Editor

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.

Advertisements

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.

Order of Menu items and Sub Menu items
Order of Menu items and Sub Menu items

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

Output - Final Menu With Two Sub-menu items
Output – Final Menu With Two Sub-menu items

The File menu will appear with two sub-menu items open and close as shown in above figure.

Advertisements

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.