Share via


Menu.LevelMenuItemStyles 속성

정의

MenuItemStyleCollection 컨트롤에서 해당 수준을 기준으로 메뉴 항목에 적용되는 스타일 설정이 들어 있는 Menu 개체를 가져옵니다.

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

속성 값

MenuItemStyleCollection

MenuItemStyleCollection 컨트롤에서 해당 수준을 기준으로 메뉴 항목에 적용되는 스타일 설정이 들어 있는 Menu입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 LevelMenuItemStyles 에서 메뉴 항목에 스타일 설정을 적용할 컬렉션을 Menu 해당 수준을 기준으로 컨트롤입니다.


<%@ 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 LevelMenuItemStyles and LevelSelectedStyles Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu LevelMenuItemStyles and LevelSelectedStyles Example</h3>

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <levelmenuitemstyles>
          <asp:menuitemstyle BackColor="LightSteelBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="SkyBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="LightSkyBlue"
            forecolor="Black"/>            
        </levelmenuitemstyles>
        <levelselectedstyles>
          <asp:menuitemstyle BackColor="Cyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="LightCyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="PaleTurquoise"
           forecolor="Gray"/>            
        </levelselectedstyles>    
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem 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 LevelMenuItemStyles and LevelSelectedStyles Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu LevelMenuItemStyles and LevelSelectedStyles Example</h3>

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <levelmenuitemstyles>
          <asp:menuitemstyle BackColor="LightSteelBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="SkyBlue"
            forecolor="Black"/>
          <asp:menuitemstyle BackColor="LightSkyBlue"
            forecolor="Black"/>            
        </levelmenuitemstyles>
        <levelselectedstyles>
          <asp:menuitemstyle BackColor="Cyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="LightCyan"
           forecolor="Gray"/>
          <asp:menuitemstyle BackColor="PaleTurquoise"
           forecolor="Gray"/>            
        </levelselectedstyles>    
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

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

설명

사용 하 여 합니다 LevelMenuItemStyles 개별 스타일 속성 대신 컬렉션 (같은 DynamicMenuItemStyle) 메뉴의 개별 수준에 있는 메뉴 항목의 스타일을 제어 합니다. 이 컬렉션에 포함 된 스타일의 메뉴 수준을 기준으로 메뉴 항목에 적용 됩니다. 컬렉션의 첫 번째 스타일 메뉴의 첫 번째 수준에 메뉴 항목의 스타일에 해당합니다. 컬렉션의 두 번째 스타일 메뉴 및 등의 두 번째 수준에 메뉴 항목의 스타일에 해당합니다. 이 컬렉션은 주로 내용을 스타일 탐색 메뉴를 생성 하는 특정 수준에서 메뉴 항목 하위 메뉴가 있는지 여부에 관계 없이 동일한 모양이 있어야 합니다.

참고

특정 사용 하는 수준에 대 한 스타일을 정의 하는 경우는 LevelMenuItemStyles 모든 메뉴 항목 수준에서 설정 메뉴 항목에 대 한 스타일 컬렉션,이 재정의 됩니다.

적용 대상

추가 정보