RAD Studio
Adding, Inserting, and Deleting Menu Items

The following procedures describe how to perform the basic tasks involved in building your menu structure. Each procedure assumes you have the Menu Designer window open.

To add menu items at design time:

  1. Select the position where you want to create the menu item.
  2. If you've just opened the Menu Designer, the first position on the menu bar is already selected. Begin typing to enter the caption. Or enter the Name property first by specifically placing your cursor in the Object Inspector and entering a value. In this case, you then need to reselect the Caption property and enter a value.
  3. Press Enter. The next placeholder for a menu item is selected. If you entered the Caption property first, use the arrow keys to return to the menu item you just entered. You'll see that Delphi has filled in the Name property based on the value you entered for the caption. (See Naming the menu items.)
  4. Continue entering values for the Name and Caption properties for each new item you want to create, or press Esc to return to the menu bar. Use the arrow keys to move from the menu bar into the menu, and to then move between items in the list; press Enter to complete an action. To return to the menu bar, press Esc .

To insert a new, blank menu item:

  1. Place the cursor on a menu item.
  2. Press Ins. Menu items are inserted to the left of the selected item on the menu bar, and above the selected item in the menu list.

To delete a menu item or command:

  1. Place the cursor on the menu item you want to delete.
  2. Press Del.
Note: You cannot delete the default placeholder that appears below the item last entered in a menu list, or next to the last item on the menu bar. This placeholder does not appear in your menu at runtime.
Separator bars insert a line between menu items and items on a toolbar. You can use separator bars to indicate groupings within the menu list or toolbar, or simply to provide a visual break in a list. 

To add a separator bar to a menu:

  • Add a menu item as described above and type a hyphen (-) for the caption.
  • Or press the hyphen (-) key while the cursor is positioned on the menu where you want a separator to appear.
To add a separator bar onto a TActionToolBar, press the insert key and set the new item's caption to a separtor bar (|) or hyphen (-). 

To add accelerators or shortcuts to menu items, see Specifying accelerator keys and keyboard shortcuts.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!