Menu.StaticSelectedStyle プロパティ
アセンブリ: System.Web (system.web.dll 内)
構文静的メニューの選択されたメニュー項目のスタイルを表す MenuItemStyle への参照。
解説ユーザーが選択した静的メニューのメニュー項目の外観を制御するには、StaticSelectedStyle プロパティを使用します。このプロパティは読み取り専用です。ただし、このプロパティが返す MenuItemStyle オブジェクトのプロパティを設定することはできます。このプロパティは、Property-Subproperty の形式で、宣言によって設定できます。Subproperty には、MenuItemStyle オブジェクトのプロパティを指定します (例 : StaticSelectedStyle-ForeColor)。Property.Subproperty の形式で、プロパティをプログラムによって設定することもできます (例 : StaticSelectedStyle.ForeColor)。
使用例StaticSelectedStyle プロパティを使用して、選択された静的メニュー項目の背景色を明るい青色に指定する方法のコード例を次に示します。
<%@ Page Language="VB" %> <html> <body> <form runat="server"> <h3>Menu StaticSelectedStyle Example</h3> <asp:menu id="NavigationMenu" staticdisplaylevels="2" staticsubmenuindent="10" orientation="Vertical" runat="server"> <staticselectedstyle backcolor=LightBlue borderstyle="Solid" bordercolor="Black" borderwidth="1"/> <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="C#" %> <html> <body> <form runat="server"> <h3>Menu StaticSelectedStyle Example</h3> <asp:menu id="NavigationMenu" staticdisplaylevels="2" staticsubmenuindent="10" orientation="Vertical" runat="server"> <staticselectedstyle backcolor=LightBlue borderstyle="Solid" bordercolor="Black" borderwidth="1"/> <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>
プラットフォームWindows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Menu クラス
Menu メンバ
System.Web.UI.WebControls 名前空間
Menu.DynamicHoverStyle プロパティ
Menu.DynamicMenuItemStyle プロパティ
Menu.DynamicMenuStyle プロパティ
Menu.DynamicSelectedStyle プロパティ
Menu.LevelMenuItemStyles プロパティ
Menu.LevelSelectedStyles プロパティ
Menu.LevelSubMenuStyles プロパティ
Menu.StaticHoverStyle プロパティ
Menu.StaticMenuItemStyle プロパティ
Menu.StaticMenuStyle プロパティ
Weblioに収録されているすべての辞書からMenu.StaticSelectedStyle プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からMenu.StaticSelectedStyle プロパティ
を検索
- Menu.StaticSelectedStyle プロパティのページへのリンク