Difference between revisions of "Creating Top-Level Menus in Visual Basic"

From Techotopia
Jump to: navigation, search
(Creating a Top-Level Menu)
(Creating a Top-Level Menu)
Line 5: Line 5:
 
== Creating a Top-Level Menu ==
 
== Creating a Top-Level Menu ==
  
Top-level menus (the type of menus that run across the top of forms) are created using the ''Menu Strip'' control. The first step in creating a menu, therefore, is to add a Menu Strip control to the form. With your Visual Studio project loaded, and the Form to which you wish to add the menu selected, double click on the ''Menu Strip'' control in the ''Menus and Toolbars'' section of the Toolbox. You will notice that the Menu Strip object is added to the panel beneath the form, and that a ''Type Here'' field appears at the top of the form.
+
Top-level menus (the type of menus that run across the top of forms) are created using the ''Menu Strip'' control. The first step in creating a menu, therefore, is to add a Menu Strip control to the form. With your Visual Studio project loaded, and the Form to which you wish to add the menu selected, double click on the ''Menu Strip'' control in the ''Menus and Toolbars'' section of the Visual Studio Toolbox. You will notice that the Menu Strip object is added to the panel beneath the form, and that a ''Type Here'' field appears at the top of the form as follows:
 +
 
 +
[[Image:Exampl.jpg]]

Revision as of 19:22, 23 July 2007

Despite Microsoft's move towards so called Ribbon based navigation, every other application still relies on menus to provide an easy way for users to navigate around a user interface. In fact, the jury is still out on whether Ribbon style interfaces of the type found in Microsoft Office 2007 are actually easier to use than menus.

Since it is almost impossible creat an application without needing a menu of some sort, this chapter is dedicated entirely to the topic of creating both top-level and context menus in Visual Basic. As you will see as we work through this topic, Visual Basic combined with Visual Studio make the creation of menus extremely easy.

Creating a Top-Level Menu

Top-level menus (the type of menus that run across the top of forms) are created using the Menu Strip control. The first step in creating a menu, therefore, is to add a Menu Strip control to the form. With your Visual Studio project loaded, and the Form to which you wish to add the menu selected, double click on the Menu Strip control in the Menus and Toolbars section of the Visual Studio Toolbox. You will notice that the Menu Strip object is added to the panel beneath the form, and that a Type Here field appears at the top of the form as follows:

File:Exampl.jpg