Menu Basics
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 drops down. 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 you define.
To make your application easier to use, you should group menu items according to their function. For example, the file-related commands New, Open, and Save As should all be found on the File menu.
Some menu items perform an action directly. For example, the Exit menu item on the File menu closes the application. Other menu items display a dialog box - a window that requires the user to supply information needed by the application to perform the action. These menu items should be followed by an ellipsis (…). For example, when you choose Save As… from the File menu, the Save File As dialog box appears.
A menu control is an object and, like other objects, it has instructions that define its appearance and behavior. Menu controls contain only one event, the Click event, which is invoked when the menu control is selected with the mouse or using the keyboard.
Pop-up Menus
A pop-up menu is a floating menu that is displayed over a form, independent of the menu bar. The items displayed on the pop-up menu depend on the location of the pointer when the right mouse button is pressed. Therefore, pop-up menus are also called context menus. You should use pop-up menus to provide an efficient method for accessing common, contextual commands.
Any menu that has at least one menu item can be displayed at run time as a pop-up menu. To display a pop-up menu, use the ACTIVATE instruction.
![]() |