Menu.DynamicMenuItemStyle プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Menu.DynamicMenuItemStyle プロパティの意味・解説 

Menu.DynamicMenuItemStyle プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

動的メニューの中のメニュー項目の外観を設定できる、MenuItemStyle オブジェクトへの参照を取得します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public ReadOnly Property
 DynamicMenuItemStyle As MenuItemStyle
Dim instance As Menu
Dim value As MenuItemStyle

value = instance.DynamicMenuItemStyle
public MenuItemStyle DynamicMenuItemStyle { get;
 }
public:
property MenuItemStyle^ DynamicMenuItemStyle {
    MenuItemStyle^ get ();
}
/** @property */
public MenuItemStyle get_DynamicMenuItemStyle ()
public function get DynamicMenuItemStyle
 () : MenuItemStyle

プロパティ値
動的メニューの中のメニュー項目のスタイルを表す MenuItemStyle への参照。

解説解説

動的メニューの中のメニュー項目の外観を制御するには、DynamicMenuItemStyle プロパティを使用します。このプロパティは読み取り専用です。ただし、このプロパティが返す MenuItemStyle オブジェクトのプロパティを設定することはできます。このプロパティは、Property-Subproperty の形式で、宣言によって設定できます。Subproperty には、MenuItemStyle オブジェクトのプロパティを指定します (例 : DynamicMenuItemStyle-ForeColor)。Property.Subproperty の形式で、プロパティをプログラムによって設定することもできます (例 : DynamicMenuItemStyle.ForeColor)。

動的メニュー項目のスタイル プロパティは、次の順序で適用されます。

  1. DynamicMenuStyle.

  2. DynamicMenuItemStyle。LevelMenuItemStyles コレクションまたは LevelSubMenuStyles コレクションが定義されている場合は、ここで適用され、他のメニュー項目スタイル プロパティをオーバーライドします。

  3. DynamicSelectedStyle。LevelSelectedStyles コレクションが定義されている場合は、ここで適用され、他のメニュー項目スタイル プロパティをオーバーライドします。

  4. DynamicHoverStyle.

使用例使用例

DynamicMenuItemStyle プロパティを使用して、動的メニューの中のメニュー項目の背景色を明るい空色に指定する方法のコード例を次に示します。

<%@ Page Language="VB" %>

<html>
  <body>
    <form runat="server">
    
      <h3>Menu DynamicMenuItemStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamicmenuitemstyle 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="C#" %>

<html>
  <body>
    <form runat="server">
    
      <h3>Menu DynamicMenuItemStyle Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"  
        runat="server">
        
        <dynamicmenuitemstyle 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>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Menu クラス
Menu メンバ
System.Web.UI.WebControls 名前空間
Menu.DynamicHoverStyle プロパティ
DynamicMenuStyle
DynamicSelectedStyle
LevelMenuItemStyles
LevelSelectedStyles
LevelSubMenuStyles
StaticHoverStyle
StaticMenuItemStyle
StaticMenuStyle
StaticSelectedStyle


このページでは「.NET Framework クラス ライブラリ リファレンス」からMenu.DynamicMenuItemStyle プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMenu.DynamicMenuItemStyle プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMenu.DynamicMenuItemStyle プロパティ を検索

英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「Menu.DynamicMenuItemStyle プロパティ」の関連用語

Menu.DynamicMenuItemStyle プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Menu.DynamicMenuItemStyle プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS