DynamicSelectedStyle Property

Menu.DynamicSelectedStyle Property

 

Gets a reference to the MenuItemStyle object that allows you to set the appearance of the dynamic menu item selected by the user.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>]
member DynamicSelectedStyle : MenuItemStyle with get

Property Value

Type: System.Web.UI.WebControls.MenuItemStyle

A reference to the MenuItemStyle that represents the style of the selected dynamic menu item.

Use the DynamicSelectedStyle property to control the appearance of a dynamic menu item when the user selects it from the menu. This property is read-only; however, you can set the properties of the MenuItemStyle object it returns. The properties can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the MenuItemStyle object (for example, DynamicSelectedStyle-ForeColor). The properties can also be set programmatically in the form Property.Subproperty (for example, DynamicSelectedStyle.ForeColor).

Style properties for a dynamic menu item are applied in the following order:

  1. DynamicMenuStyle.

  2. DynamicMenuItemStyle. If the LevelMenuItemStyles collection or LevelSubMenuStyles collection is defined, it is applied at this time, overriding the other menu item style properties.

  3. DynamicSelectedStyle. If the LevelSelectedStyles collection is defined, it is applied at this time, overriding the other menu item style properties.

  4. DynamicHoverStyle.

The following code example demonstrates how to use the DynamicSelectedStyle property to specify a light blue background color for the selected dynamic menu item.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft