SlideShare a Scribd company logo
2
Most read
3
Most read
6
Most read
MENU’s
-Visual Basic 6.0
Menus
 Menus are one of the most important features of a
software product. Every standard software must
have menus. You generally see a menu on top of
a software interface. Menus are controls but
different from the controls in the ToolBox and they
don't work like the other controls. You can drop a
menu on the form from the Menu Editor Window.
Press Ctrl+E to show the Menu Editor Window or
right-click on the form and click Menu Editor. The
Menu Editor Window can also be shown from the
Menu Editor icon of the ToolBar.
Building a menu
Building a menu is very simple, you can do it on your own. Simply fill
the Caption and Name field in the Menu Editor Window and click ok to
create it. 

Click the right-arrow button to create a submenu. Click
Next to create the next menu item, and click ok once
you're done editing the menu items.
Visual Basic menu
A simple form with menu:
Properties of the menu items
 The important properties of the menu items are
Name, Caption, Checked, Enabled, Shortcut and
Visible. As per your programming need, set the
properties either in run-time or in design time. You
can create a shortcut key for a menu item. In
some situations you may want to disable a menu
item, you can acquire it through the Enabled
property.
The menu control exposes only one event, the
Click event. 
Example: Make a menu as same as the following
image.
Visual Basic menu
 Now write the following code.
 Private Sub mnuBlue_Click()
    Form1.BackColor = vbBlue 'Makes the Form blue
End Sub
___________________________________________________________
___
Private Sub mnuGreen_Click()
    Form1.BackColor = vbGreen 'Makes the form green
End Sub
___________________________________________________________
___
Private Sub mnuRed_Click()
    Form1.BackColor = vbRed  'Makes the form red
End Sub
___________________________________________________________
___
Private Sub mnuWhite_Click()
    Form1.BackColor = vbWhite  'Makes the form white
End Sub
  
  Now run the program and Click on the menu items and see
what happens.
 The Checked property
 Design a form like the output image of the following program.
Create a Help menu and drop a Label control on the form with
the caption 'Help'.
Now write the following code.
 Private Sub mnuShowHelp_Click()
    If mnuShowHelp.Checked = True Then
        mnuShowHelp.Checked = False
        Label2.Visible = False
    ElseIf mnuShowHelp.Checked = False Then
        mnuShowHelp.Checked = True
        Label2.Visible = True
    End If
End Sub
Output:

More Related Content

PPTX
Visual Basic Controls ppt
PPT
Visual basic
PPTX
toolbox and its properties in the visual basic
PDF
TAMIL KATTURAIGAL
PPTX
PPT
Microsoft visual basic 6
PPTX
Characteristics of computer.pptx
PPTX
Network devices
Visual Basic Controls ppt
Visual basic
toolbox and its properties in the visual basic
TAMIL KATTURAIGAL
Microsoft visual basic 6
Characteristics of computer.pptx
Network devices

What's hot (20)

PPTX
Visual basic
PPTX
Controls events
PDF
Visual Basic IDE Introduction
PPTX
Windows form application - C# Training
PDF
Visual Basic 6.0
PDF
VB.Net-Controls and events
PPTX
Windowforms controls c#
PDF
Html frames
PPTX
Variable and constants in Vb.NET
PPTX
JAVA AWT
PPTX
PPTX
Id and class selector
DOCX
Common dialog control
PPTX
Ado.Net Tutorial
PDF
Sequence Diagram
PPT
Working with color and font
PPTX
Graphical User Interface (GUI)
PPT
Visual basic ppt for tutorials computer
PPT
visual basic v6 introduction
PPT
Input and output in C++
Visual basic
Controls events
Visual Basic IDE Introduction
Windows form application - C# Training
Visual Basic 6.0
VB.Net-Controls and events
Windowforms controls c#
Html frames
Variable and constants in Vb.NET
JAVA AWT
Id and class selector
Common dialog control
Ado.Net Tutorial
Sequence Diagram
Working with color and font
Graphical User Interface (GUI)
Visual basic ppt for tutorials computer
visual basic v6 introduction
Input and output in C++
Ad

Viewers also liked (16)

PPT
ADO CONTROLS - Database usage
PPT
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
PDF
Visual Basic 6.0
PPS
Vb.net session 04
PDF
Visual basic menu
PPT
Vb basics
DOCX
Menu vb
PPT
VB Codes
PPT
VB6 Using ADO Data Control
PPT
Visual basic 6.0
PPTX
Sdi & mdi
PPTX
Data base connectivity and flex grid in vb
DOC
PDF
The Best Source Code VB
PPT
Introduction to visual basic programming
PPT
Visual Basic Codes And Screen Designs
ADO CONTROLS - Database usage
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
Visual Basic 6.0
Vb.net session 04
Visual basic menu
Vb basics
Menu vb
VB Codes
VB6 Using ADO Data Control
Visual basic 6.0
Sdi & mdi
Data base connectivity and flex grid in vb
The Best Source Code VB
Introduction to visual basic programming
Visual Basic Codes And Screen Designs
Ad

Similar to Visual Basic menu (20)

PPT
VB6_OBJECTS AND GRAPHICS.ppt
PDF
Autodesk maya 2016 basic guide
PPT
Google calendar integration in iOS app
PPT
Components of windows.36
PPT
Power Point Project 5
PDF
Guide to Fix Dropdown Button Not Switching Selected Item | Flutter
PPT
4.1 Thecast by roshan kumar sah lecture slide
PPT
Buttons In .net Visual Basic
PDF
Review chapter 1 3 part 2
DOCX
Computer applications lab manual
PDF
Microsoft Windows 7 Fundamentals (8th Ed.)
PDF
DOCX
Introduction to ms word
DOCX
The visual studio start page is shown in the figure below
PPTX
DOC-20230724-WA0011..pptxyffhjingtrfhiijh
PDF
Software engineering modeling lab lectures
PDF
Financial Analysis with Microsoft Excel 4th Edition Timothy R.(Timothy R. May...
VB6_OBJECTS AND GRAPHICS.ppt
Autodesk maya 2016 basic guide
Google calendar integration in iOS app
Components of windows.36
Power Point Project 5
Guide to Fix Dropdown Button Not Switching Selected Item | Flutter
4.1 Thecast by roshan kumar sah lecture slide
Buttons In .net Visual Basic
Review chapter 1 3 part 2
Computer applications lab manual
Microsoft Windows 7 Fundamentals (8th Ed.)
Introduction to ms word
The visual studio start page is shown in the figure below
DOC-20230724-WA0011..pptxyffhjingtrfhiijh
Software engineering modeling lab lectures
Financial Analysis with Microsoft Excel 4th Edition Timothy R.(Timothy R. May...

Recently uploaded (20)

PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
presentation_pfe-universite-molay-seltan.pptx
DOCX
Unit-3 cyber security network security of internet system
PPTX
Digital Literacy And Online Safety on internet
PPT
tcp ip networks nd ip layering assotred slides
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Internet___Basics___Styled_ presentation
PPTX
Funds Management Learning Material for Beg
PPTX
Introduction to Information and Communication Technology
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Paper PDF World Game (s) Great Redesign.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Introuction about WHO-FIC in ICD-10.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
WebRTC in SignalWire - troubleshooting media negotiation
SASE Traffic Flow - ZTNA Connector-1.pdf
SAP Ariba Sourcing PPT for learning material
presentation_pfe-universite-molay-seltan.pptx
Unit-3 cyber security network security of internet system
Digital Literacy And Online Safety on internet
tcp ip networks nd ip layering assotred slides
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Job_Card_System_Styled_lorem_ipsum_.pptx
Internet___Basics___Styled_ presentation
Funds Management Learning Material for Beg
Introduction to Information and Communication Technology
PptxGenJS_Demo_Chart_20250317130215833.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Unit-1 introduction to cyber security discuss about how to secure a system
Paper PDF World Game (s) Great Redesign.pdf

Visual Basic menu

  • 2. Menus  Menus are one of the most important features of a software product. Every standard software must have menus. You generally see a menu on top of a software interface. Menus are controls but different from the controls in the ToolBox and they don't work like the other controls. You can drop a menu on the form from the Menu Editor Window. Press Ctrl+E to show the Menu Editor Window or right-click on the form and click Menu Editor. The Menu Editor Window can also be shown from the Menu Editor icon of the ToolBar.
  • 3. Building a menu Building a menu is very simple, you can do it on your own. Simply fill the Caption and Name field in the Menu Editor Window and click ok to create it.   Click the right-arrow button to create a submenu. Click Next to create the next menu item, and click ok once you're done editing the menu items.
  • 5. A simple form with menu:
  • 6. Properties of the menu items  The important properties of the menu items are Name, Caption, Checked, Enabled, Shortcut and Visible. As per your programming need, set the properties either in run-time or in design time. You can create a shortcut key for a menu item. In some situations you may want to disable a menu item, you can acquire it through the Enabled property. The menu control exposes only one event, the Click event.  Example: Make a menu as same as the following image.
  • 8.  Now write the following code.  Private Sub mnuBlue_Click()     Form1.BackColor = vbBlue 'Makes the Form blue End Sub ___________________________________________________________ ___ Private Sub mnuGreen_Click()     Form1.BackColor = vbGreen 'Makes the form green End Sub ___________________________________________________________ ___ Private Sub mnuRed_Click()     Form1.BackColor = vbRed  'Makes the form red End Sub ___________________________________________________________ ___ Private Sub mnuWhite_Click()     Form1.BackColor = vbWhite  'Makes the form white End Sub   
  • 9.   Now run the program and Click on the menu items and see what happens.  The Checked property  Design a form like the output image of the following program. Create a Help menu and drop a Label control on the form with the caption 'Help'. Now write the following code.  Private Sub mnuShowHelp_Click()     If mnuShowHelp.Checked = True Then         mnuShowHelp.Checked = False         Label2.Visible = False     ElseIf mnuShowHelp.Checked = False Then         mnuShowHelp.Checked = True         Label2.Visible = True     End If End Sub