Applications use menu bars to provide an organized collection of commands that
can be performed by the user. Menus can inform the user of the application's capabilities
as well as its limitations. If a program has properly organized menus, users can
easily find common commands as well as less-familiar features. Users can also
learn shortcut keys from a well-designed menu structure.
Because menus have so many benefits to the
user, a programmer should be well-versed in
their creation and the functions they can provide.
Programmers can use one of two different methods to create menus in VB. The
first is a built-in Menu Editor dialog box. This editor provides a fast, simple
way to generate menus. Once made, all menu objects can have their properties set
through program code. The other method uses the Win32 Application Programmers
Interface. The Win32 API is a series of functions that are by VB and provided
by the operating system. By using specialized function calls, a programmer can
create menus, set properties of menus, and modify menu structure. Most of the
functionality found in the API is also available using the Menu Editor. Although
more difficult to work with, the API provides enhanced function calls and special
capabilities not part of the VB Menu Editor. However, using the API is beyond
the scope of this chapter.