Menu.LevelSubMenuStyles Özellik

Tanım

Statik menüdeki alt menü öğelerine uygulanan stil ayarlarını içeren bir MenuItemStyleCollection nesneyi, Menu denetimdeki düzeylerine göre alır.

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

Özellik Değeri

Bir MenuItemStyleCollection denetimdeki düzeylerine Menu göre statik menüde alt menü öğelerine uygulanan stil ayarlarını içeren.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, düzeyine göre denetimin LevelSubMenuStylesMenu statik menüsünde görüntülenen alt menü öğelerine stil ayarları uygulamak için koleksiyonun nasıl kullanılacağını gösterir.


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

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="3"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <levelsubmenustyles>
          <asp:submenustyle backcolor="LightSteelBlue"
            forecolor="Black"/>
          <asp:submenustyle backcolor="SkyBlue"
            forecolor="Gray"/>          
        </levelsubmenustyles>  
      
        <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 LevelSubMenuStyles</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu LevelSubMenuStyles</h3>

      <asp:menu id="NavigationMenu"
        staticdisplaylevels="3"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <levelsubmenustyles>
          <asp:submenustyle backcolor="LightSteelBlue"
            forecolor="Black"/>
          <asp:submenustyle backcolor="SkyBlue"
            forecolor="Gray"/>          
        </levelsubmenustyles>  
      
        <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>

Açıklamalar

Tek düzeylerdeki LevelSubMenuStyles statik menüde görüntülenen statik alt menü öğelerinin stilini denetlemek için koleksiyonu tek tek stil özelliklerine (örneğin) alternatif olarak StaticMenuItemStylekullanın. Bu koleksiyonda yer alan stiller, menü düzeyine göre statik alt menü öğelerine uygulanır. Koleksiyondaki ilk stil, statik menüde görüntülenen ilk statik alt menü düzeyinin stiline karşılık gelir. Koleksiyondaki ikinci stil, statik menüde görüntülenen ikinci alt menü düzeyinin stiline karşılık gelir ve bu şekilde devam eder. Bu koleksiyon çoğunlukla, alt menüleri olup olmadığına bakılmaksızın belirli bir düzeydeki menü öğelerinin aynı görünüme sahip olması gereken içindekiler stilinde gezinti menüleri oluşturmak için kullanılır.

Note

Bir stil, koleksiyonu kullanılarak LevelSubMenuStyles belirli bir düzey için tanımlanmışsa, bu, bu düzeydeki tüm statik alt menü öğesi stili ayarlarını geçersiz kılar.

Şunlara uygulanır

Ayrıca bkz.