Home>>Operating System>> » Use the Menu Designer to Create Menu

Use the Menu Designer to Create Menu

Last Updated on August 4, 2018 By hcyaobin

How to create and manage menus?

Menus provide an easy way for your users to execute logically grouped commands. The Menu Designer enables you to easily add a menu–either predesigned or custom tailored–to your form. You add a menu component to the form, open the Menu Designer, and type menu items directly into the Menu Designer window. You can add or delete menu items, or drag and drop them to rearrange them during design time.

You don’t even need to run your program to see the results–your design is immediately visible in the form, appearing just as it will during runtime. Your code can also change menus at runtime, to provide more information or options to the user.

This section explains how to use the Menu Designer to design menu bars and pop-up (local) menus. It discusses the following ways to work with menus at design time and runtime:

  1. Opening the Menu Designer.
  2. Building menus.
  3. Editing menu items in the Object Inspector.
  4. Using the Menu Designer context menu.
  5. Using menu templates.
  6. Saving a menu as a template.
  7. Adding images to menu items.

Opening the Menu Designer

You design menus for your application using the Menu Designer. Before you can start using the Menu Designer, first add either a MainMenu or PopupMenu component to your form. Both menu components are located on the Standard page of the Component palette.

A MainMenu component creates a menu that’s attached to the form’s title bar. A PopupMenu component creates a menu that appears when the user right-clicks in the form. Pop-up menus do not have a menu bar.

To open the Menu Designer, select a menu component on the form, and then either:

  • Double-click the menu component.
    or
  • From the Properties page of the Object Inspector, select the Items property, and then either double-click [Menu] in the Value column, or click the ellipsis (…) button.

The Menu Designer appears, with the first (blank) menu item highlighted in the Designer, and the Caption property selected in the Object Inspector.

How to edit menu items in the Object Inspector?

This section has discussed how to set several properties for menu items–for example, the Name and Caption properties–by using the Menu Designer.
The section has also described how to set menu item properties, such as the ShortCut property, directly in the Object Inspector, just as you would for any component selected in the form.

When you edit a menu item by using the Menu Designer, its properties are still displayed in the Object Inspector. You can switch focus to the Object Inspector and continue editing the menu item properties there. Or you can select the menu item from the Component list in the Object Inspector and edit its properties without ever opening the Menu Designer.

To close the Menu Designer window and continue editing menu items,

  1. Switch focus from the Menu Designer window to the Object Inspector by clicking the properties page of the Object Inspector.
  2. Close the Menu Designer as you normally would.

The focus remains in the Object Inspector, where you can continue editing properties for the selected menu item. To edit another menu item, select it from the Component list.

More Steps to Manage Menus

Due to the long text, the remain steps to build a menu and manage it, click the following links, it would take you to the detail articles.

 

 

Add a Comment

Your email address will not be published. Required fields are marked *