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

PPT
Vb introduction.
sagaroceanic11
 
PPTX
Visual Basic Controls ppt
Ranjuma Shubhangi
 
PPTX
Basic controls of Visual Basic 6.0
Salim M
 
PPT
Introduction to visual basic programming
Roger Argarin
 
PPT
VB.net
PallaviKadam
 
PPTX
Introduction to vb.net
Jaya Kumari
 
PPTX
toolbox and its properties in the visual basic
adarsh-kaul
 
PPTX
Graphical User Interface (GUI)
Estiak Khan
 
Vb introduction.
sagaroceanic11
 
Visual Basic Controls ppt
Ranjuma Shubhangi
 
Basic controls of Visual Basic 6.0
Salim M
 
Introduction to visual basic programming
Roger Argarin
 
VB.net
PallaviKadam
 
Introduction to vb.net
Jaya Kumari
 
toolbox and its properties in the visual basic
adarsh-kaul
 
Graphical User Interface (GUI)
Estiak Khan
 

What's hot (20)

PPT
ADO .Net
DrSonali Vyas
 
PDF
Visual Basic 6.0
Anjan Mahanta
 
PPTX
Sdi & mdi
BABAVALI S
 
PPTX
VB Function and procedure
pragya ratan
 
PPT
The msg box function and the messagebox class
Faisal Aziz
 
PPTX
Windows form application - C# Training
Moutasm Tamimi
 
PDF
Visual Basic IDE Introduction
Ahllen Javier
 
PPT
Assembler
manpreetgrewal
 
PPTX
Functions in C
Kamal Acharya
 
PPS
Procedures functions structures in VB.Net
tjunicornfx
 
PPTX
Objects and classes in Visual Basic
Sangeetha Sg
 
PPTX
Basics of JAVA programming
Elizabeth Thomas
 
PDF
VB net lab.pdf
Prof. Dr. K. Adisesha
 
PPTX
Ado.Net Tutorial
prabhu rajendran
 
PPT
Database Management System Introduction
Smriti Jain
 
PPTX
Cohesion and coupling
Aprajita (Abbey) Singh
 
PPT
Visual basic
umesh patil
 
PPT
4.C#
Raghu nath
 
PPTX
Assemblies
Janas Khan
 
PPTX
Visual Programming
Bagzzz
 
ADO .Net
DrSonali Vyas
 
Visual Basic 6.0
Anjan Mahanta
 
Sdi & mdi
BABAVALI S
 
VB Function and procedure
pragya ratan
 
The msg box function and the messagebox class
Faisal Aziz
 
Windows form application - C# Training
Moutasm Tamimi
 
Visual Basic IDE Introduction
Ahllen Javier
 
Assembler
manpreetgrewal
 
Functions in C
Kamal Acharya
 
Procedures functions structures in VB.Net
tjunicornfx
 
Objects and classes in Visual Basic
Sangeetha Sg
 
Basics of JAVA programming
Elizabeth Thomas
 
VB net lab.pdf
Prof. Dr. K. Adisesha
 
Ado.Net Tutorial
prabhu rajendran
 
Database Management System Introduction
Smriti Jain
 
Cohesion and coupling
Aprajita (Abbey) Singh
 
Visual basic
umesh patil
 
Assemblies
Janas Khan
 
Visual Programming
Bagzzz
 
Ad

Viewers also liked (16)

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
 
PPT
Visual basic 6.0
Aarti P
 
PPTX
Data base connectivity and flex grid in vb
Amandeep Kaur
 
PPT
Microsoft visual basic 6
Penang, Malaysia
 
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
 
Visual basic 6.0
Aarti P
 
Data base connectivity and flex grid in vb
Amandeep Kaur
 
Microsoft visual basic 6
Penang, Malaysia
 
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
 

Recently uploaded (20)

PDF
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
PPTX
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
PDF
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
PPTX
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
PDF
UI/UX Developer Guide: Tools, Trends, and Tips for 2025
Penguin peak
 
PDF
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
PPTX
Crypto Recovery California Services.pptx
lionsgate network
 
PPTX
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
PPTX
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PPTX
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
PPT
Transformaciones de las funciones elementales.ppt
rirosel211
 
PDF
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
PDF
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PDF
PDF document: World Game (s) Great Redesign.pdf
Steven McGee
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PPTX
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
PPTX
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
UI/UX Developer Guide: Tools, Trends, and Tips for 2025
Penguin peak
 
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
Crypto Recovery California Services.pptx
lionsgate network
 
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
Pengenalan perangkat Jaringan komputer pada teknik jaringan komputer dan tele...
Prayudha3
 
Different Generation Of Computers .pptx
divcoder9507
 
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
Transformaciones de las funciones elementales.ppt
rirosel211
 
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PDF document: World Game (s) Great Redesign.pdf
Steven McGee
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 

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