Muokkaa

Jaa


WebPartZoneBase.MenuVerbHoverStyle Property

Definition

Gets style information for the appearance of a verb in a verbs drop-down menu when an end user positions the mouse pointer over the verb.

public:
 property System::Web::UI::WebControls::Style ^ MenuVerbHoverStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style MenuVerbHoverStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.MenuVerbHoverStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property MenuVerbHoverStyle As Style

Property Value

A Style that contains style information for a verb when a user positions the mouse pointer over the verb.

Attributes

Examples

The following code example demonstrates the declarative use of the MenuVerbHoverStyle property on a WebPartZone control. For the full code example, including the code-behind source file and the .aspx page that contains the zone in this code, see the WebPartZoneBase class overview.

Notice that the MenuVerbHoverStyle property has a value assigned to it in the declarative markup. This value impacts WebPartZone2. After you load the page into a browser, switch the page into edit mode. Click the verbs menu, and notice that the background color for the verbs menu on the control in WebPartZone2 is the color assigned to it in the declarative markup.

<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>

Remarks

The style information contained in the MenuVerbHoverStyle property applies to an individual verb in a verbs menu, when a user positions a mouse pointer over one of the verbs.

Although this property is read-only, you can set the style attributes of the underlying Style object.

Because the menu that contains the verbs is created using Microsoft Internet Explorer's pop-up object, the menu does not correctly render its border when you place your mouse pointer over verbs that have different text lengths. The best workaround for this is to declare a <MenuVerbHoverStyle> element with an invisible border, so the menu width for all verbs is exactly the same size. The declarative element would occur within a zone, and would look as follows:

<asp:WebPartZone ID="WebPartZone1" runat="server">  
  <MenuVerbHoverStyle BorderStyle="Solid" BorderWidth="1px"       BorderColor="White" />  
  <ZoneTemplate>  
      <asp:Button ID="Button1" runat="server" Text="Button" />  
  </ZoneTemplate>  
</asp:WebPartZone>  

Applies to

See also