Creation of the menu in visual basic, Visual Basic Programming

Assignment Help:

Creation of the Menu in VB

1. Initiate a new project by choosing a file and then new project.

2. Now select the Standard EXE as the Project type.

3. Build the Form1 active by clicking on it.

4. Pick the Tools and then Menu Editor to open the menu editor for designing.

5. Provide the caption as &display (i.e. display becomes the menu title)

6. Type a name. Suppose it be Mnudisp. This is a user defined.

7. To add the menu items click the next button in the menu editor.

8. Provide the caption as &square (i.e. square becomes the menu item)

9. Type a name. Suppose it be mnusquare. This is a user defined.

10. Relate a short cut key. The list box will pop up. Select a key. Say you have selected Ctrl + G. Then, to activate this menu item you require pressing CTRL and G keys altogether.

11. Put the checked property of the menu item square by clicking on the check box for the checked property.

12. Double click on the menu item. This takes you to the code window.

13. Type the given below code for the menu item square

Private Sub mnusquare_Click()

If (Form1.mnusquare.Checked) = False Then

Form1.mnusquare.Checked = True

Else

Form1.mnusquare.Checked = False

End If

End Sub

14. Whenever you click on square menu item for the first time, the property Checked is set to TRUE. Therefore the else part executes and sets the property Checked to the FALSE. The control behaves as a toggle.

15. To address the controls on the form, then use the form name. The menu item we want to manipulate is mnusquare .And hence, to access the control we say Form1.mnusquare.Later we want to manipulate Checked property. Therefore we are qualifying it as the Form1.mnusquare.Checked

16. Select the Run option.

17. Select the Start With Full Compile.

18. The form will be displayed.

19. Click on the disp menu title

20. The sub menu pops up. You have square as the menu item. Note that the check mark is as shown in figure.

21. If you click on the menu item square then the check mark will disappear during the next execution.

22. Clicking once further time will bring the check mark.

972_menu editor.png

Figure: The Menu Editor

2219_menu item square.png

Figure: Menu Item Square


Related Discussions:- Creation of the menu in visual basic

Dynamic link library - dll , DYNAMIC LINK LIBRARY - DLL   The DLL are ...

DYNAMIC LINK LIBRARY - DLL   The DLL are files which can be called when required by the other program that is running in the computer. The DLL files which support the specific

If - else statement, A variation on the If...Then...Else statement lets you...

A variation on the If...Then...Else statement lets you to choose from various alternatives. By adding up Else If clauses expands the functionality of the If...Then...Else statement

Adding records - data control, Adding Records: 1. As in the earlier ca...

Adding Records: 1. As in the earlier case Set the DatabaseName property as "C:\ex.mdb", now Set the Record Source for the data control as Customer and Set the Record Type to 0

Visual basic program, Create the flowcharts using MS Visio, MS Excel or MS ...

Create the flowcharts using MS Visio, MS Excel or MS Word to demonstrate the algorithm. Submit your flowchart under the assignment for CH7-4-26 Flowchart. Part Printouts H

Dictionary object in vbscript, The Dictionary object stores data as key, it...

The Dictionary object stores data as key, item pairs. A Dictionary object is the corresponding of a PERL associative array. Items, that can be any form of data, are stored in the a

Adding events in visual basic , Adding Events in VB   For adding the e...

Adding Events in VB   For adding the events in VB, first double click on the command button with the caption hello. The Private Sub command1_Click () and End Sub would be

Help, Assume that s is a string variable that is supposed to contain a va...

Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displ

While loop - vbscript, In VBScript, the While...Wend statement is provided ...

In VBScript, the While...Wend statement is provided for those who are familiar along its usage. However, due to the lack of flexibility in While...Wend, it is suggested that you us

Record set - database applications, Record Set: The record set present...

Record Set: The record set presents the records in a base table or the records retrieved due to the query. The record set falls into 3 classes. These are table type record set

Precompiled header file, THE PRECOMPILED HEADER FILE As soon as you gen...

THE PRECOMPILED HEADER FILE As soon as you generate a blank project, ahead of doing any coding you compile the project to generate .pch (that is the pre compiled header) file a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd