If you want your application to provide a set of commands to users, menus offer a convenient and consistent way to group commands and an easy way for users to access them. The menu bar appears immediately below the title bar on the form and contains one or more menu titles. When you click a menu title (such as File), a menu containing a list of menu items appears. Menu items can include commands (such as New and Exit), separator bars, and submenu titles. Each menu item the user sees corresponds to a menu control property you define. Multiple menus can be added to one form.
To add a menu to your form
Note You can also highlight the MainMenu control on the Toolbox and, holding down the left mouse button, drag the control onto your form.
The MainMenu control is inserted onto your form, and the default location for the first item on the menu bar is displayed. Two visual markers (Type Here) appear directly to the right and below to signify the next available editing locations.
Note By default, the MainMenu property for the form is set to MainMenu1.
Forms may have several menus, such as File/Save and File/SaveAs. You can switch menus by changing the Menu property for the form to a different menu name, for example, mainMenu2.
To add access keys to a menu
To add shortcut (action) keys to a menu item
To remove a shortcut key
To enable check marks on a menu
To move a menu
The actual menu caption moves and snaps to place. Other menu captions that are affected by this change are moved as appropriate.
Note Moving top-level menu captions will move all child members, as well. Child members are not displayed during the move.
To modify a menu
To create a menu separator bar
A separator bar appears directly below your menu caption.
-or-
Separator bars may be moved and deleted in the same manner as regular menu captions.
To delete a menu item from your form
Note To delete the entire menu, highlight each menu caption and press DELETE, or click the MainMenu1 control and select Delete from the context menu.
Confirmation on deletion only occurs on menu captions with sub-menus.