Design Main Menu using VB.NET

In this article you will learn How to Design a Main Menu in VB.NET.
  • 9593

Main menu is the primary list of options available to the user at the computer. The main menu is the starting point; for example in windows, the start menu is the main menu. VB.Net provide an easy to use facility for adding a Main Menu to a form, which is the menu that appears at the top of a form. Given steps are followed to create a main menu:-

Step 1: Add a MenuStrip control from toolbox to a form. The control will appear in the component designer tray at the bottom of the designer window.

1.gif

Step 2: Now add items to the menu by click wherever you see "Type Here" in the Menu Designer and type the text of the main menu item then enter like FILE, EDIT, VIEW. Additional entry appear below and to the right of the entry like NEW, OPEN.

3.gif


Step 3: Now add a new windows form in existing form to go in project menu than in add new item.

4.gif

Step 4: Double click on new option in file menu in form1 and write down the following code.

                                Public Class Form1

                     Private Sub NewToolStripMenuItem_Click

(ByVal sender As System.Object,

 ByVal e As System.EventArgs)

 Handles NewToolStripMenuItem.Click

                             Form2.Show()
                     End Sub
            End Class

Step 5: Execute the application and form2 will open.

5.gif

CONCLUSON

By using these above simple steps you can learn how to work with menu strip control in visual basic.
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.