Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visual Basic Menu Editor

Similar presentations


Presentation on theme: "Visual Basic Menu Editor"— Presentation transcript:

1 Visual Basic Menu Editor
Menu Creation 8 April 2019 Prepared By: Deborah Becker

2 Prepared By: Deborah Becker
Goals of This Lesson Create Application (form) Menus Offer Menu options that let the user: Access Files Print Reports Calculate totals etc. Help To display Information About the System 8 April 2019 Prepared By: Deborah Becker

3 Prepared By: Deborah Becker
Create A Project From the Start Menu Select Programs, Then Microsoft Visual Studio Activate the VB 6 Program From the Option Box Click Icon to create a Project 8 April 2019 Prepared By: Deborah Becker

4 Prepared By: Deborah Becker
The Menu Wizard Press Ctrl-E To activate Menu Editor It will appear like this graphic The editor will help you design your application menus. 8 April 2019 Prepared By: Deborah Becker

5 Prepared By: Deborah Becker
Menu Editor Box Menu Properties Control List Box 8 April 2019 Prepared By: Deborah Becker

6 The Menu Property Section
In The Menu Property Section You will designate the names & captions of your menu controls. Here is where you define menu options 8 April 2019 Prepared By: Deborah Becker

7 Prepared By: Deborah Becker
Step 1: Add Menu Options The Screen will look like this… 8 April 2019 Prepared By: Deborah Becker

8 Step 2: Add these options
Files Print Reports Calculate Help Include Accelerator Keys 8 April 2019 Prepared By: Deborah Becker

9 at 3 steps for each Option.
Press Ctrl-E To Activate Menu Editor Type–&File Maintenance (in the Caption box) Press tab to advance to the Name box Type–mnuFile (in the Name Box) Leave all other field alone & click—Next to prepare for the other menu options 8 April 2019 Prepared By: Deborah Becker

10 Prepared By: Deborah Becker
Step 3, Continued Type “Print &Reports” in the Caption Type mnuPrint (in the Name Box) Press Next to prepare for the next option Type &Ca&lculate ” (Caption) Type mnuCalculate (in the Name Box) Type &Help in the Caption Type mnuHelp (in the name box) 8 April 2019 Prepared By: Deborah Becker

11 The Menu editor should look like this
8 April 2019 Prepared By: Deborah Becker

12 Prepared By: Deborah Becker
Test The Menu Click the button to close the menu editor; and save your project Press F5 to run the application Because we have not added any procedures nothing happens when you click on the menu bar at the top of the form Press the stop button on the edit bar Press Ctrl-E to finish creating the menu 8 April 2019 Prepared By: Deborah Becker

13 Prepared By: Deborah Becker
Insert a blank row: Highlight Print &Report in the Menu control list Click the button Add Ce&real Master to Caption and mnuFileCereal to name Click the Menu Editor’s right arrow button VB puts an ellipses Before Ce&real Master ... This will insert a blank line between &File and &Color and allow you to add a menu option to the File menu You must tell Visual Basic that you are adding a pull down menu bar and not a primary menu option. This tell VB that the current item will be a menu option and will not appear on the menu bar. 8 April 2019 Prepared By: Deborah Becker

14 Prepared By: Deborah Becker
Add These Other Files Add these Options to the File Menu Sweet Cereal File Manufacturer file Exit Add these Options to the Print Menu Sweet Cereal List Manufacturer Cereal List Cereal Master List 8 April 2019 Prepared By: Deborah Becker

15 Prepared By: Deborah Becker
Add These Other Files Add this Option to the Calculate Menu Summary Data Finally add this Option to the Help Menu About 8 April 2019 Prepared By: Deborah Becker

16 Prepared By: Deborah Becker
The Help About Form Press Projectadd Form Select the About Form from the list of wizard forms Be careful using accelerator keys Don’t use letters that are used by Microsoft, O is used for Open X is used or Cut x is used for Exit Look at the menu accelerator keys 8 April 2019 Prepared By: Deborah Becker

17 Prepared By: Deborah Becker
Connecting Your Menu We will only connect the Exit option on the File Maintenance menu and the About option on the Help Menu. 8 April 2019 Prepared By: Deborah Becker

18 Prepared By: Deborah Becker
Connecting The Exit While the frmFormName is active as an object; click on the File menu and then click on the Exit option This will activate the code screen with the Private Sub mnuFileExit_Click() End Sub --already waiting for you Add the code in the graphic Unload Me 8 April 2019 Prepared By: Deborah Becker

19 Prepared By: Deborah Becker
Activate Help About While the frmFormName is active as an object; click on the Help menu and then click on the About option This will activate the code screen with the Private Sub mnuHelpAbout_Click() End Sub already waiting for you Add the code in the graphic frmAbout.Show vbModal 8 April 2019 Prepared By: Deborah Becker

20 Prepared By: Deborah Becker
Adding Shortcut Keys From the frmFormName object view press Ctrl-E to activate the Menu Editor Highlight the Cereal Master option in the menu list box Click on the Shortcut combo box Select from the predefined list 8 April 2019 Prepared By: Deborah Becker

21 Prepared By: Deborah Becker
Possibilities I selected these for the File Menu Cereal Master File Ctrl-E Manufacturer File Ctrl-U Sweet Cereal File Ctrl-T Exit F11 8 April 2019 Prepared By: Deborah Becker


Download ppt "Visual Basic Menu Editor"

Similar presentations


Ads by Google