C1WebMenu contains items and groups. The groups are the C1WebSubMenus. The items can be a link, custom, or separator item.
Link Items
Link items are derived from the base class C1WebLinkItem. C1WebMenu's link items can easily be configured to represent a set of links by using the NavigateUrl property. This property gets the URL link for the menu item. Please remember in menu items you can't specify both a ClientScripts and a NavigateUrl for the same link item.
To access the NavigateUrl property using the C1WebCommandEditor – C1WebMenu1 collection editor, follow the steps below:
1. Right-click on C1WebMenu and select Edit from its C1WebMenu Tasks menu. The C1WebCommandEditor – C1WebMenu appears.
2. Select an item from the tree view.
3. Expand the Appearance node in the item's properties window.
There are five styles and states for the link items. Each style and state is determined by its property settings for Enabled and Selected.
Style |
State |
Property Settings |
ItemStyle |
Normal |
Enabled = True, Selected = False, mouse doesn't hover over item. |
MouseOverItemStyle |
Mouse Over |
Enabled = True, Selected = False, mouse hovers over item. |
SelectedItemStyle |
SelectedState |
Enabled = True, Selected = True, mouse doesn't hover over item. |
MouseOverSelectedItemStyle |
Mouse Over Selected |
Enabled = True, Selected = True, mouse hovers over item. |
DisabledItemStyle |
Disabled |
Enabled = False |
The item styles listed above are accessible programmatically through C1WebLinkItems object or by the design editor, C1WebCommandEditor – C1WebMenu Collection Editor. To access the C1WebLinkItem's style properties using the C1WebCommandEditor – C1WebMenu Collection Editor, follow the steps below:
1. Right-click on C1WebMenu and select Edit from its C1WebMenu Tasks menu. The C1WebCommandEditor – C1WebMenu appears.
2. Select an item from the tree view.
3. Expand the Style node in the item's properties window.
To access the C1WebLinkItem's properties through code using the C1WebLinkItem object, follow the code below. This method can be applied the same way for the remaining C1WebLinkItem properties.
'Create an instance of the class
Dim menu As C1WebMenu = New C1WebMenu
menu.MouseOverItemStyle.CssClass = "MouseOverMenuLinkItem";
· C#
// create an instance of the class
C1WebMenu menu = new C1WebMenu();
menu.MouseOverItemStyle.CssClass = "MouseOverMenuLinkItem";
· Delphi
// create an instance of the class
var
menu: C1WebMenu;
begin
menu := C1WebMenu.Create;
menu.MouseOverItemStyle.CssClass = "MouseOverMenuLinkItem";
end;
Custom Content Items
Custom content items are derived from the base class C1WebContentItem. Each item includes content property. The Content property includes built-in editable templates and controls such as a calendar control.
Separators
C1WebMenu's items can be displayed as separators. Separators are also known as delimiters. The user has the option to customize the separators color, size, style, and padding. For more information about separator styles, please see Defining the Separator Style and its Types.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |