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 more 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, as shown in the following image. 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.
Use the Menu Items dialog box, shown in the following image, to determine the menu items that will appear on your menu bar, including pull-down menus and submenus.
This dialog box includes the following options:
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.
Choose your property based on the task you wish to perform:
If you want to change the name of the menu bar that identifies it to the procedure, use the (Name) Property. For more information, see the (Name) Property.
If you want to change the color of the menu bar, use a style sheet or the ForeColor Property to determine the color of the text in the box. Use the BackColor Property to determine the color of the box.
If you want to add a border to the menu bar, use a style sheet or the Border Property.
If you want to add a border to an individual menu item, use a style sheet or the ItemBorder Property.
If you want to change the size of the location or size of the menu bar, use a style sheet or resize the line directly in the form. You can also use the Bottom Property, Left Property, Right Property, and Top Property.
If you want to change what the cursor looks like when it is on top of the menu bar, use the CursorPointer Property or use a style sheet.
If you want to change the color of the text or the background when the cursor is on top of the menu bar, use the BackColorOver Property and the ForeColorOver Property. You can also use a style sheet.
If you want to make the menu bar inactive or make it invisible, use the Enabled Property to determine whether the is active or not. If the line is inactive, nothing will happen when the end user clicks it. You can also use the Visible Property to determine whether the line is visible to the end user or use a style sheet. For more information, see the Enabled Property and the Visible Property.
If you want to assign a Help topic to the menu control, use the Help Property. For more information, see Assigning Help to Your Forms and Controls.
If you want to move the menu bar to another layer, use the Layer Property. For more information, see Layering Controls.
If you want to change the alignment of your menu bar from vertical to horizontal, or vice versa, use the Orientation Property.
If you want to display a tooltip when the cursor is on the top of the menu controls, use the ToolTipText Property.
WebFOCUS |