Menu.DynamicHoverStyle 속성

정의

마우스 포인터를 동적 메뉴 항목의 위로 가져갈 때 표시되는 모양을 설정할 수 있는 Style 개체에 대한 참조를 가져옵니다.

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

속성 값

Style

마우스 포인터를 동적 메뉴 항목의 위로 가져갈 때 표시되는 스타일을 나타내는 Style에 대한 참조입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 DynamicHoverStyle 위에 마우스 포인터를 가져갈 때 동적 메뉴 항목의 배경색을 연한 하늘색 변경할 속성입니다.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu DynamicHoverStyle Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu DynamicHoverStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu DynamicHoverStyle Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu DynamicHoverStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

설명

사용 된 DynamicHoverStyle 마우스 포인터 위로 가져갈 때 동적 메뉴 항목의 모양을 제어 하는 속성입니다. 이 속성은 읽기 전용입니다. 그러나의 속성을 설정할 수는 Style 개체를 반환 합니다. 속성 형식에서 선언적으로 설정할 수 있습니다 Property-Subproperty, 여기서 Subproperty 속성인 합니다 Style 개체 (예를 들어 DynamicHoverStyle-ForeColor). 형식에서 속성을 프로그래밍 방식으로 설정할 수도 있습니다 Property.Subproperty (예를 들어 DynamicHoverStyle.ForeColor).

동적 메뉴 항목에 대 한 스타일 속성은 다음 순서 대로 적용 됩니다.

  1. DynamicMenuStyle.

  2. DynamicMenuItemStyle. 경우는 LevelMenuItemStyles 컬렉션 또는 LevelSubMenuStyles 컬렉션이 정의 된, 다른 메뉴 항목 스타일 속성을 재정의이 이번에 적용 됩니다.

  3. DynamicSelectedStyle. 경우는 LevelSelectedStyles 컬렉션이 정의 된, 다른 메뉴 항목 스타일 속성을 재정의이 이번에 적용 됩니다.

  4. DynamicHoverStyle.

적용 대상

추가 정보