Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Saturday, July 23, 2011

VB-58 : Design a Menu Bar

Using menu editor, design a menu bar that contains two titles "Colors" and "Exit".
The colors menu has menu item "Fill Color" .
When the Fill Color is clicked another menu pops up with a list of colors (Red,Blue,Green).This is the sub-menu of the Fill Color.
Upon selecting the particular color the form should fill with that color.
Upon selecting the Exit , the application should be terminated.
===============================================
Refer Program Using Menu Bar & Creating Tool Bar with Click Event 


Select Tools--> Menu Editor and create menus as per given below :




You can watch this Video to know about adding Menu Bar into our form.


     (A)Program Design : 





(B) Property(Controls Used) :

No
Caption
Name
Index
1
Color
mnu_color

  1a
      Fill Color
mnu_sub_Fill

   1a(1)
           Red
mnu_sub_color
0
   1a(2)
           Blue
mnu_sub_color
1
   1a(3)
          Green
mnu_sub_color
2
2
Exit
mnu_exit



  • Color & Exit are main menus.
  • Fill color is the sub menu of Color
  • Red,Blue,Green are the sub menus of Fill color
(C) Attaching Code to the Object :



Private Sub mnu_exit_Click()
End
End Sub
Private Sub mnu_sub_color_Click(Index As Integer)
Select Case Index
Case 0
Form1.BackColor = vbRed
Case 1
Form1.BackColor = vbBlue
Case 2
Form1.BackColor = vbGreen
End Select
End Sub

Refer Create a Menu as per the format given also.
====================================================================
=========================================================

1 comment:

Niraj said...

Video is not working......
plz upload any other video with the full method of creating menus
thnaks..