Visual Basic Concepts

Creating Submenus

Each menu you create can include up to five levels of submenus. A submenu branches off another menu to display its own menu items. You may want to use a submenu when:

  • The menu bar is full.

  • A particular menu control is seldom used.

  • You want to emphasize one menu control's relationship to another.

If there is room on the menu bar, however, it's better to create an additional menu title instead of a submenu. That way, all the controls are visible to the user when the menu is dropped down. It's also good programming practice to restrict the use of submenus so users don't get lost trying to navigate your application's menu interface. (Most applications use only one level of submenus.)

In the Menu Editor, any menu control indented below a menu control that is not a menu title is a submenu control. In general, submenu controls can include submenu items, separator bars, and submenu titles.

To create a submenu

  1. Create the menu item that you want to be the submenu title.

  2. Create the items that will appear on the new submenu, and indent them by clicking the right arrow button.

    Each indent level is preceded by four dots (....) in the Menu Editor. To remove one level of indentation, click the left arrow button.

**Note   **If you're considering using more than a single level of submenus, think about using a dialog box instead. Dialog boxes allow users to specify several choices in one place. For information on using dialog boxes, see "Dialog Boxes" later in this chapter.