0% found this document useful (0 votes)
760 views3 pages

Menu Bar

The document discusses how to add a menu bar to a Visual Basic application. It describes two methods: using the Application Wizard or the Menu Editor. It provides step-by-step instructions for using the Menu Editor to add top-level menu items like "File" and nested submenu items like "New", "Open", etc. Screenshots illustrate each step of the process for building out the menu structure within the Menu Editor and viewing the final menu bar implementation on a Visual Basic form.

Uploaded by

lalitha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
760 views3 pages

Menu Bar

The document discusses how to add a menu bar to a Visual Basic application. It describes two methods: using the Application Wizard or the Menu Editor. It provides step-by-step instructions for using the Menu Editor to add top-level menu items like "File" and nested submenu items like "New", "Open", etc. Screenshots illustrate each step of the process for building out the menu structure within the Menu Editor and viewing the final menu bar implementation on a Visual Basic form.

Uploaded by

lalitha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Menu bar is the standard feature of most windows applications.

The main purpose of


the menus is for easy navigation and control of an application. Some of the most
common menu items are File, Edit, View, Tools, Help and more. Each item on the
main menu bar also provide a list of options or in the form of a pull-down menu.
When you create a Visual Basic 6 program, you need not include as many menu
items as a full fledge Windows application such as Microsoft Words. What you need is
to include those menu items that can improve the ease of using your program by the
user, and not to confuse the user with unnecessary items. Adding menu bar is
relatively easy to accomplish in Visual Basic. There are two ways to add menus to
your application, one way is to use the Visual Basic's Application Wizard and the
other way is to use the menu editor.

Adding Menu Bar Using Menu Editor

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

You might also like