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

What's hot (20)

DOCX
Common dialog control
Soumya Vijoy
 
PPTX
Attributes of output primitive(line attributes)
shalinikarunakaran1
 
PPTX
Toolbar
kuldeep94
 
PPTX
Vb.net ide
Faisal Aziz
 
PPTX
Visual Programming
Bagzzz
 
PPTX
Graphical User Interface
Bivek Pakuwal
 
PPTX
Data types vbnet
nicky_walters
 
PPTX
Metrics for project size estimation
Nur Islam
 
PPTX
Attributes of output primitives( curve attributes & area fill attributes)
shalinikarunakaran1
 
PPTX
Ado.Net Tutorial
prabhu rajendran
 
PPTX
Dialog box in vb6
Saroj Patel
 
PPTX
Attributes of output Primitive
SachiniGunawardana
 
PPTX
Graphical User Interface (Gui)
Bilal Amjad
 
PPTX
Output primitives in Computer Graphics
Kamal Acharya
 
PPT
Visual basic 6.0
Aarti P
 
PPT
Intro to scan conversion
Mohd Arif
 
PPTX
Computer graphics basic transformation
Selvakumar Gna
 
PPT
Assembler
manpreetgrewal
 
PPTX
Vb 6.0 controls
'Bharat Kumar
 
PPS
Vb6.0 Introduction
Tennyson
 
Common dialog control
Soumya Vijoy
 
Attributes of output primitive(line attributes)
shalinikarunakaran1
 
Toolbar
kuldeep94
 
Vb.net ide
Faisal Aziz
 
Visual Programming
Bagzzz
 
Graphical User Interface
Bivek Pakuwal
 
Data types vbnet
nicky_walters
 
Metrics for project size estimation
Nur Islam
 
Attributes of output primitives( curve attributes & area fill attributes)
shalinikarunakaran1
 
Ado.Net Tutorial
prabhu rajendran
 
Dialog box in vb6
Saroj Patel
 
Attributes of output Primitive
SachiniGunawardana
 
Graphical User Interface (Gui)
Bilal Amjad
 
Output primitives in Computer Graphics
Kamal Acharya
 
Visual basic 6.0
Aarti P
 
Intro to scan conversion
Mohd Arif
 
Computer graphics basic transformation
Selvakumar Gna
 
Assembler
manpreetgrewal
 
Vb 6.0 controls
'Bharat Kumar
 
Vb6.0 Introduction
Tennyson
 

Viewers also liked (15)

PPT
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
PPT
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
Muralidharan Radhakrishnan
 
PDF
Visual Basic 6.0
MuralirajSanjeev
 
PPT
Visual basic ppt for tutorials computer
simran153
 
PPS
Vb.net session 04
Niit Care
 
PDF
Visual basic menu
Happy Nezza Aranjuez
 
PPT
Vb basics
sagaroceanic11
 
DOCX
Menu vb
Amandeep Kaur
 
PPT
VB Codes
prcastano
 
PPT
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
PPTX
Sdi & mdi
BABAVALI S
 
PPTX
Data base connectivity and flex grid in vb
Amandeep Kaur
 
DOC
Vb file
Mukund Trivedi
 
PDF
The Best Source Code VB
Nurdin Al-Azies
 
PPT
Visual Basic Codes And Screen Designs
prcastano
 
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
Muralidharan Radhakrishnan
 
Visual Basic 6.0
MuralirajSanjeev
 
Visual basic ppt for tutorials computer
simran153
 
Vb.net session 04
Niit Care
 
Visual basic menu
Happy Nezza Aranjuez
 
Vb basics
sagaroceanic11
 
Menu vb
Amandeep Kaur
 
VB Codes
prcastano
 
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
Sdi & mdi
BABAVALI S
 
Data base connectivity and flex grid in vb
Amandeep Kaur
 
The Best Source Code VB
Nurdin Al-Azies
 
Visual Basic Codes And Screen Designs
prcastano
 
Ad

Similar to Visual Basic menu (20)

PPTX
DOC-20230724-WA0011..pptxyffhjingtrfhiijh
MAADHESH2
 
PPTX
Menu stripe
Conestoga Collage
 
PPT
VB6_OBJECTS AND GRAPHICS.ppt
BhuvanaR13
 
PPTX
Module iii part i
Sumaja Varma
 
PDF
Intake 38 8
Mahmoud Ouf
 
PDF
Intake 37 8
Mahmoud Ouf
 
PPT
chap005 (1) dialogue box menus presentattion
arulrajvetias
 
PDF
Visualbasic tutorial
Andi Simanjuntak
 
PPT
Creating menu in visual basic 6
Eclaro College
 
PPTX
Introduction to visual basic 6 (1)
Mark Vincent Cantero
 
PDF
Visual basic
Shabista Imam
 
PPTX
Vb6.0 intro
JOSEPHINEA6
 
DOCX
Visual basic concepts
melody77776
 
PPT
Chapter 05
Terry Yoast
 
DOCX
Bm0025 visual basic
smumbahelp
 
PPT
Session 6 Bai 6 ve winform
mrtom16071980
 
PDF
Neha
SethiAshish
 
PPTX
UNIT - 1 VISUAL BASIC PRESENTATION FOR IT
gayathripcs
 
DOC
Practicalfileofvb workshop
dhi her
 
DOC-20230724-WA0011..pptxyffhjingtrfhiijh
MAADHESH2
 
Menu stripe
Conestoga Collage
 
VB6_OBJECTS AND GRAPHICS.ppt
BhuvanaR13
 
Module iii part i
Sumaja Varma
 
Intake 38 8
Mahmoud Ouf
 
Intake 37 8
Mahmoud Ouf
 
chap005 (1) dialogue box menus presentattion
arulrajvetias
 
Visualbasic tutorial
Andi Simanjuntak
 
Creating menu in visual basic 6
Eclaro College
 
Introduction to visual basic 6 (1)
Mark Vincent Cantero
 
Visual basic
Shabista Imam
 
Vb6.0 intro
JOSEPHINEA6
 
Visual basic concepts
melody77776
 
Chapter 05
Terry Yoast
 
Bm0025 visual basic
smumbahelp
 
Session 6 Bai 6 ve winform
mrtom16071980
 
UNIT - 1 VISUAL BASIC PRESENTATION FOR IT
gayathripcs
 
Practicalfileofvb workshop
dhi her
 
Ad

Recently uploaded (20)

PPTX
02 IoT Industry Applications and Solutions (1).pptx
abuizzaam
 
PDF
Digital Security in 2025 with Adut Angelina
The ClarityDesk
 
PPTX
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
PDF
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
PPTX
Random Presentation By Fuhran Khalil uio
maniieiish
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
PDF
The Complete Guide to Chrome Net Internals DNS – 2025
Orage Technologies
 
PDF
The Power and Impact of Promotion most useful
RajaBilal42
 
PDF
APNIC's Role in the Pacific Islands, presented at Pacific IGF 2205
APNIC
 
PDF
Pas45789-Energs-Efficient-Craigg1ing.pdf
lafinedelcinghiale
 
PPTX
1.10-Ruta=1st Term------------------------------1st.pptx
zk7304860098
 
PDF
Technical Guide to Build a Successful Shopify Marketplace from Scratch.pdf
CartCoders
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PPTX
Presentation on Social Media1111111.pptx
tanamlimbu
 
PPTX
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
PPT
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
PDF
DORA - MobileOps & MORA - DORA for Mobile Applications
Willy ROUVRE
 
PPTX
ipv6 very very very very vvoverview.pptx
eyala75
 
PDF
Slides PDF: ZPE - QFS Eco Economic Epochs pdf
Steven McGee
 
02 IoT Industry Applications and Solutions (1).pptx
abuizzaam
 
Digital Security in 2025 with Adut Angelina
The ClarityDesk
 
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
Random Presentation By Fuhran Khalil uio
maniieiish
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
本科硕士学历佛罗里达大学毕业证(UF毕业证书)24小时在线办理
Taqyea
 
The Complete Guide to Chrome Net Internals DNS – 2025
Orage Technologies
 
The Power and Impact of Promotion most useful
RajaBilal42
 
APNIC's Role in the Pacific Islands, presented at Pacific IGF 2205
APNIC
 
Pas45789-Energs-Efficient-Craigg1ing.pdf
lafinedelcinghiale
 
1.10-Ruta=1st Term------------------------------1st.pptx
zk7304860098
 
Technical Guide to Build a Successful Shopify Marketplace from Scratch.pdf
CartCoders
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
Presentation on Social Media1111111.pptx
tanamlimbu
 
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
DORA - MobileOps & MORA - DORA for Mobile Applications
Willy ROUVRE
 
ipv6 very very very very vvoverview.pptx
eyala75
 
Slides PDF: ZPE - QFS Eco Economic Epochs pdf
Steven McGee
 

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