ARTICLE

How to Design a Main Menu in VB.NET

Posted by Sapna Articles | Visual Basic Language July 01, 2010
In this article you will learn How to Design a Main Menu in VB.NET.
 
Reader Level:

HTML clipboard

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

Fig.1

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.

2.gif

Fig.2

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

3.gif

Fig.3

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.

4.gif

Fig.4

CONCLUSON

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

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor