In this section: How to: Reference: |
The menu control enables you to create a menu bar with pull-down menus in your form. You may create only one menu bar per form.
Using the menu control requires two steps:
To create a pull-down menu or submenu, complete the following steps from the Menu Items dialog box. This procedure assumes that you have already placed a menu bar on your form. For information on how to place a menu bar on your form, see How to Place a Menu Bar on Your Form.
For more information on assigning actions to events, see Defining Events and Event Handlers.
The following example demonstrates how to create a pull-down menu that contains submenus.
Note: You can change the orientation of the menu control by changing the Orientation property in the property sheet.
The highest level menu items will appear on your form. Readjust the size and placement of your menu bar if necessary. An arrow on a menu item indicates that the menu item contains submenus.
For more information on assigning actions to events, see Defining Events and Event Handlers.
You use the Menu Items dialog box to determine the menu items that will appear on your menu bar, including pull-down menus and sub menus.
The Menu Items dialog box contains the following elements:
Enables you to specify the prompt text for each item.
Enables you to specify the name of each item.
Enables you to add a selected item to the list of menu items.
Deletes a selected item from the list of items.
Moves a selected item up in the list of items.
Moves a selected item down in the list of items.
When you select your menu control, you will see a list of control properties in the property sheet. Changing these properties will change what your menu bar looks like and what it does at run time.
Many of the styling properties can also be changed using a Cascading Style Sheet. For more information on Cascading Style Sheets, see Using Cascading Style Sheets.
Do you want... |
Then use... |
---|---|
to change the name of the menu bar that identifies it to the procedure? |
the (Name) Property property. |
to change the color of the menu bar? |
the BackColor Property property to determine the color of the box. the ForeColor Property property to determine the color of the text in the box. a style sheet. |
to add a border to the menu bar? |
the Border Property property. a style sheet. |
to add a border to an individual menu item? |
the ItemBorder Property property. a style sheet. |
to change the size or location of the menu bar? |
the Bottom Property, Left Property, Right Property, and Top Property properties. a style sheet. (You can also move or resize the menu bar directly in the form.) |
to change what the cursor looks like when it is on top of the menu bar? |
the CursorPointer Property property. a style sheet. |
to change the color of the text or the background when the cursor is on top of the menu bar? |
the BackColorOver Property and ForeColorOver Property properties. a style sheet. |
to make the menu bar inactive or make it invisible? |
the Enabled Property property to determine whether the menu bar is active or not. (If the menu bar is inactive, it will be grayed out and nothing will happen when the end user clicks it.) the Visible Property property to determine whether the menu bar is visible to the end user. a style sheet. |
to assign a help topic to the menu control? |
the Help property. For more information, see Assigning Help to Your Forms and Controls. |
to move the menu bar to another layer? |
the Layer property. For more information, see Layering Controls. |
to change the alignment of your menu bar from vertical to horizontal, or vice versa? |
the Orientation Property property. |
to display a tool tip when the cursor is on top of the menu controls? |
the ToolTipText Property property. |
WebFOCUS |