Re: How to create a common menu for whole proj? #1
Hi,
Creating a menu in Visual Basic
Open Visual Basic. A dailog screen prompts us to choose the type of application. Choose the standard EXE icon from the dialog screen. A form is displayed with a name Form1 for the Project1. Choose Project1 properties from the Project menu option and change the project name to iLiven and click on Ok button. Save the form as Menuform.frm using the Save Form As option in the file menu. Save the project as iLiven.vbp using the Save Project As option in the file menu.
To change the caption of the form to iLiven, press F4 to get the properties window and type iLiven in the caption property and name of the form to MenuForm. This form is named as MenuForm because it will hold the menu for the application we are going to develop. To add the menu options to the application we use the menu editor. Choose the menu editor from tools option. Following are the steps to create the menu.
Type text in the Caption text box and same text in the Name text box. Caption appears in the menu bar while the name is referred to in programming. Press Next button to add another menu option. While the control is on one option, press right arrow or left arrow to determine the level. Down arrow or up arrow moves the entry.
The menu options are connected to their respective forms. The form is connected to a menu option is as shown below. The code for the menu items is written in the MenuForm. The code for Accounts menu item is given below:
Private Sub AccAdd_Click()
‘Procedure for Activating Accounts Creation Form
Load AccDialog
AccDialog.Show
End Sub