advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Menu Control Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 Usage Notes
   ■ With menu controls, you can design and display a customized menu in your
     application. Menu items can include commands the user can choose to
     carry out an action, menu titles, and separator bars.
 
   ■ A menu control exists for each menu title and menu item. These menu
     controls can be named uniquely or grouped together by creating a
     control array. Use the LOAD Statement to add a menu item to a control
     array at run time. See: Creating a Control Array  LOAD Statement
 
   ■ Menu controls that remain visible on a form and make up the menu bar
     are called menu titles. Menu items are the menu controls that make up
     a menu and become visible only when a top-level menu title is selected.
     You can define up to five levels of menus.
 
   ■ Menu items are created at design time using the Menu Design window in
     the Form Designer. When a menu item is selected, the Click event occurs.
     If the item selected is top level, the DropDown event also occurs for
     the first item in the cascading menu. This allows you to write code to
     initialize the menu before it is displayed. See: DropDown Event
 
   ■ When a menu title is selected, the associated menu is displayed. Any
     code written for the menu title's Click event is executed. It is not
     advisable to write menu title Click event code that will cause a Paint
     or any other events. A menu title's Click event should only be used to
     change property values of lower level menu items.
 
   ■ Menu controls have several unique property settings that affect the
     appearance and accessibility of a menu item. These settings are
     described in the following table:
 
     Property   Setting      Description
     ════════   ══════════   ═══════════════════════════════════════════════
     Caption    - (hyphen)   Item displayed as a separator bar.(1)
     Caption    & (before    Letter in caption appears underlined; pressing
                a letter)    Alt+ the letter selects this menu item.
     Checked    True (-1)    Item appears with small dot (•) to the left;
                             dot does not appear if item is top level.(2)
     Enabled    True (-1)    Item receives events and displays a cascading
                             menu (if one exists) when selected.
     Enabled    False (0)    Item is unavailable; no action is performed when
                             selected.
     Visible    False (0)    Item is not displayed on the menu; any gaps are
                             filled in by remaining menu items.
     Separator  True (-1)    Item displayed as a separator bar.(1)
     ────────────────────────────────────────────────────────────────────────
     (1) A separator bar is created when you enter a single hyphen (-) in the
         Caption box or select the Separator check box in the Menu Design
         window.
     (2) A dot (•) is displayed next to a menu item when you select the
         Checked check box in the Menu Design window.
 
     See: Caption Property    Checked Property  Enabled Property
          Separator Property  Visible Property