Visual Basic 6 Black Book:Visual Basic Menus
Menu items can also be disabled (also called “grayed out”), as shown in Figure 5.1. A
disabled item is not accessible to the user and does nothing if selected.
TIP: If your program presents the user with a lot of disabled menu items, the user
may feel locked out and frustrated. To avoid such situations, many programs add or
remove menu items from menus at runtime, and we’ll see how to do that in this
Access Characters And Shortcuts
Ideally, each item should have a unique access character for users who choose
commands with keyboards. The user reaches the menu or menu item by pressing Alt
key and the access character. The access character should be the first letter of the
menu title, unless another letter offers a stronger link; no two menus or menu items
should use the same access character.
Shortcuts are also useful to the user; these keys are faster than access characters in that
the user only needs to enter a shortcut to execute the corresponding menu item. For
example, the New Project shortcut in Figure 5.1 is Ctrl+N.
Note also that an ellipsis (…) should follow names of menu items that display a dialog
box (Save As…, Preferences…, etc.) when selected. In addition, if you have menus in
the menu bar that execute a command immediately instead of opening a menu, you
should append an exclamation point to the menu’s name, such as Collate!
Designing Your Menus
A popular aspect of Windows is that it gives the user a common interface, no matter
what program they’re using, and users have come to expect that. In fact, if it’s hard to
learn a new, nonstandard Windows program, the user may well turn to a Windows-
compliant alternative, so it’s a good idea to stick with the Windows standards.
Most programs have a File menu first (at left) in the menu bar, followed by other
menus, like a View menu, a Tools menu, and so on, followed by a Help menu, which
usually appears last (and often at the extreme right in the menu bar). Users expect to
find certain standard items in particular menus; for a list of these items, see “What Item
Goes In What Menu?” in this chapter.
Microsoft recommends that you keep your menu item names short. For one thing, if
you want to release your application internationally, the length of words tends to
increase approximately 30 percent in foreign versions, and you may not have enough
space to list all of your menu items. Microsoft also recommends that you use the mnu
prefix in code for menus, like mnuFile, and menu items, like mnuFileOpen.
file:///E|/Program%20Files/KaZaA/My%20Shared%...Basic%20-%20%20Black%20Book/ch05/153-157.html (3 of 4) [7/31/2001 8:57:57 AM]