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.
Creating a Menu
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Creating a Menu
■ The Menu Design window is used to create a menu bar that displays the
menus titles available for use on a form. See: ◄Menu Definitions►
■ You can write code to make your menu respond dynamically to user
preferences or run-time conditions. For example, you can control whether
or not a menu item is visible, enabled, added, and so on.
■ To create a menu bar:
1. From the Window menu in the Form Designer, choose Menu Design Window
2. In the Caption text box, type the menu item caption
• To create a separator bar in your menu, type a single hyphen (-) in
this box. See: ◄Separator Property►
• To give the user keyboard access to the menu item, type an ampersand
(&) before the letter you want to specify as the access key. At run
time, this letter is highlighted or underlined, and the user can
access the menu or command by pressing Alt+ the access key.
See: ◄Access Keys►
3. In the CtlName text box, type a control name
This is the name that you'll use to refer to the menu item in code.
This name can be identical to the caption.
4. Use the left (◄) or right (►) buttons to change the level of a menu
item
You can move the menu item from a higher level to a lower level or vice
versa. You can have up to six levels of menus.
5. You can use other options to design your application's menus:
• Select Checked to place a bullet next to the menu item at run time.
• Select Separator to display the menu item as a separator bar.
• Type a value in the Tag box that you want use in code.
• Use the up or down arrows to change the position of a menu item (up
or down in the list box).
• Choose Next to move to the next line and add another item to the
menu.
• Choose Insert to add a line before the currently selected line.
• Choose Delete to delete the currently selected line.
6. Repeat steps 3 to 5 to add menu items
7. Choose Done to accept all the changes and apply them
• Changes are applied to the selected form.
• The menu you've created is visible at design time, but no events are
generated until you write code. See: ◄Creating an Event Procedure►
■ Optional features for custom menus include:
• In the Index text box, type a number that determines the control's
position within a control array. See: ◄Creating a Control Array►
• To assign a shortcut key to a menu item, select a key from the Shortcut
Key drop-down list.
• Select the Checked box if you want a small check mark to appear at the
left of a menu item to indicate that the control is turned on, or to
indicate which of several modes is in effect.
• Select the Enabled box if you want the menu item to initially respond to
events. Clear the box if you want the menu item to be unavailable (it
will appear dimmed on the menu). An initially unavailable item can later
be enabled through code.
• Select the Visible box if you want the menu item to appear on the menu.
See: ◄Access Keys►
◄Creating a Menu Control Array►
◄Editing a Menu►
◄Menu Control►
◄Tutorial: Adding Menus To Your Forms►