MenuStrip Control in VB.NET

In this article we will learn what is MenuStrip Control and how to use it.
  • 5345
 

A Visual Basic MenuStrip Control Provides a MenuBar On the form.It replaces the Features of  MainMenu control.It provides an application menu system. this control support overflow, menu merging, tool tips.MenuStrip Control works with Multiple Document InterFace(MDI) and also with Single Document Interface(SDI).

Properties of MenuStripControl:-

  • ShortcutKeys: Either you can Get or set the shortcut keys available with the ToolStripMenuItem
     
  • CanOverflow: you can get or set a value showing whether the MenuStrip Support OverFlow feature.
     
  • GripStyle: For the visibility of the grip used to reposition the control.
     
  • AutoSize: a value Showing whether the control is automatically resized to display its entire contents.
     

How to use the MenuStrip Control In vb.net:

  • First drag the MenuStrip Control from the toolbox on the form .than the window will looks like the below window

    MenuStrip1.gif

    MenuStrip12.gif
     
     
  • Now add the Menu items.After adding the menu names the form looks Like the below Form

    MenuStrip3.gif
     
  • Now Type Text to create  SubMenu of the Menu

    MenuStrip4.gif
     
  • Than add the Following code on the Form load to show the MenuStrip on left side

    PrivateSub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
        'Shows a MenuStrip to left
         MenuStrip1.Dock = DockStyle.Left
    End
    Sub

    Output:-

    MenuStrip13.gif

    MenuStrip6.gif
     

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.