System.Web.UI.WebControls.MenuItemStyle Class

Represents the style of a menu item in a System.Web.UI.WebControls.Menu control. This class cannot be inherited.

See Also: MenuItemStyle Members

Syntax

public sealed class MenuItemStyle : Style

Remarks

Use the System.Web.UI.WebControls.MenuItemStyle class to represent the style of a menu item in the System.Web.UI.WebControls.Menu control. A menu item is displayed in either a static menu or a dynamic menu. A static menu is always displayed in a System.Web.UI.WebControls.Menu control, whereas a dynamic menu is displayed only when the user positions the mouse pointer over a parent menu item that contains a dynamic submenu. You can specify different style characteristics (such as font size and color) for each of the different menu item types. The following table lists the available menu item styles.

Menu.DynamicHoverStyle

The style settings for a dynamic menu item when the mouse pointer is positioned over it.

Menu.DynamicMenuItemStyle

The style settings for an individual dynamic menu item.

Menu.DynamicMenuStyle

The style settings for a dynamic menu.

Menu.DynamicSelectedStyle

The style settings for the currently selected dynamic menu item.

Menu.StaticHoverStyle

The style settings for a static menu item when the mouse pointer is positioned over it.

Menu.StaticMenuItemStyle

The style settings for an individual static menu item.

Menu.StaticMenuStyle

The style settings for a static menu.

Menu.StaticSelectedStyle

The style settings for the currently selected static menu item.

When multiple style properties are set for a static menu item, the style properties are applied in the following order:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

Likewise, the style properties for a dynamic menu item are applied in the following order:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

The System.Web.UI.WebControls.MenuItemStyle class inherits most of its members from the System.Web.UI.WebControls.Style class. It extends the System.Web.UI.WebControls.Style class by providing properties that control the amount of space around a menu item's text, as well as the space between adjacent menu items. Use the MenuItemStyle.HorizontalPadding property to control the amount of space to the left and right of the menu item's text. Similarly, the MenuItemStyle.VerticalPadding property controls the amount of space above and below the menu item's text. You can control the amount of spacing between the menu item that the System.Web.UI.WebControls.MenuItemStyle object is applied to and its adjacent menu items by setting the MenuItemStyle.ItemSpacing property.

For more information on the inherited style settings, see System.Web.UI.WebControls.Style.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0