VB 6 Adding Menu Bar To Form

Advertisements
Advertisements

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

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.

Visual Basic 6.0 Programming by Examples Kindle Edition

Visual Basic is one of the easiest to learn computer programming language.
Yes, it is obsolete, but all MS Office products include VBA (Visual Basic for Application) and if you learn VB, you will know VBA!
In my tutorial, I used VB 6 to explain step by step how to create a simple Visual Basic Application and a relatively complex one (a Patient Management system) that is using a database. A patient Management application source code is explained in detail.
You will learn how to design and create a database in MS Access and how to create tables and queries.
The book includes a sample application that shows how to use Windows API function.
You will learn how to convert VB program that can be run only in Visual Basic development environment to a distributable application that can be installed on any client computer.
For illustration, I included 128 screenshot images and links to a video.
You will be able to download from my website complete source code for 7 Visual Basic projects including a Password Keeper, a Patient Management and a Billing Management application.
Get Your Copy Today!

Advertisements
Advertisements
Advertisements