Creating Your First Menu

There are two ways to create a menu in .NET. Using Visual Studio .NET is by far the easiest. However, it can obscure some of the internal workings, and so later in this chapter you will see a simple menu that uses Notepad.

To get started, fire up Visual Studio .NET and start a new project. Drag a MainMenu item from the Toolbox onto your Form, as shown in Figure 18-1.

Figure 18-2. New menu item


There are a few things to notice in Figure 18-1. First, in the upper-lefthand corner is the new menu item, ready for you to add text. This placement makes adding the menu items incredibly easy. Second, in the lower-lefthand corner, a non-UI element, mainMenu1, has been added. Its properties are visible in the properties window.

Windows Forms and the .NET Framework

Getting Started

Visual Studio .NET


Windows Forms

Dialog Boxes

Controls: The Base Class

Mouse Interaction

Text and Fonts

Drawing and GDI+

Labels and Buttons

Text Controls

Other Basic Controls

TreeView and ListView

List Controls

Date and Time Controls

Custom Controls

Menus and Bars


Updating ADO.NET

Exceptions and Debugging

Configuration and Deployment

Programming. NET Windows Applications
Programming .Net Windows Applications
ISBN: 0596003218
EAN: 2147483647
Year: 2003
Pages: 148 © 2008-2020.
If you may any questions please contact us: