Menu.StaticMenuItemStyle 속성

정의

정적 메뉴에서 메뉴 항목의 모양을 설정하는 데 사용할 수 있는 MenuItemStyle 개체에 대한 참조를 가져옵니다.

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

속성 값

MenuItemStyle

정적 메뉴에서 메뉴 항목의 스타일을 나타내는 MenuItemStyle에 대한 참조입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 StaticMenuItemStyle 속성을 정적 메뉴에서 메뉴 항목에 대 한 연한 하늘색 배경색을 지정 합니다.


<%@ 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" >
  <head runat="server">
    <title>Menu StaticMenuItemStyle Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticMenuItemStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="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" >
  <head runat="server">
    <title>Menu StaticMenuItemStyle Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticMenuItemStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSkyBlue"
          forecolor="Black"
          borderstyle="Solid"
          borderwidth="1"
          bordercolor="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>

설명

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

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

  1. StaticMenuStyle.

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

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

  4. StaticHoverStyle.

적용 대상

추가 정보