Menu.StaticHoverStyle Property

 

Gets a reference to the Style object that allows you to set the appearance of a static menu item when the mouse pointer is positioned over it.

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

[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>]
member StaticHoverStyle : Style with get

Property Value

Type: System.Web.UI.WebControls.Style

A reference to the Style that represents the style of a static menu item when the mouse pointer is positioned over it.

Use the StaticHoverStyle property to control the appearance of a static menu item when the mouse pointer is positioned over it. This property is read-only; however, you can set the properties of the Style object it returns. The properties can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the Style object (for example, StaticHoverStyle-ForeColor). The properties can also be set programmatically in the form Property.Subproperty (for example, StaticHoverStyle.ForeColor).

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

  1. StaticMenuStyle.

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

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

  4. StaticHoverStyle.

The following code example demonstrates how to use the StaticHoverStyle property to change the background color of a static menu item to light sky blue when the user positions the mouse pointer over it.

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

.NET Framework
Available since 2.0
Return to top
Show: