Menu.StaticEnableDefaultPopOutImage プロパティ

定義

静的メニュー項目にサブメニューがあることを示す組み込みイメージを表示するかどうかを示す値を取得または設定します。

public:
 property bool StaticEnableDefaultPopOutImage { bool get(); void set(bool value); };
public bool StaticEnableDefaultPopOutImage { get; set; }
member this.StaticEnableDefaultPopOutImage : bool with get, set
Public Property StaticEnableDefaultPopOutImage As Boolean

プロパティ値

Boolean

サブメニューのある静的メニュー項目に対して組み込みイメージを表示する場合は true。それ以外の場合は false。 既定値は、true です。

次のコード例では、プロパティを StaticEnableDefaultPopOutImage 使用して、静的メニュー項目にサブメニューがあることを示すイメージを非表示にする方法を示します。 イメージを StaticPopOutImageUrl 非表示にするには、プロパティを空の文字列 ("") に設定する必要もあります。


<%@ 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 StaticEnableDefaultPopOutImage Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticEnableDefaultPopOutImage Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticenabledefaultpopoutimage="false"
        dynamichorizontaloffset="10" 
        staticdisplaylevels="1"
        orientation="Vertical"   
        runat="server">
      
        <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 StaticEnableDefaultPopOutImage Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticEnableDefaultPopOutImage Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticenabledefaultpopoutimage="false"
        dynamichorizontaloffset="10" 
        staticdisplaylevels="1"
        orientation="Vertical"   
        runat="server">
      
        <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>

注釈

静的メニュー項目にサブメニューが含まれている場合は、ユーザーがメニューを展開できることを示す画像を表示できます。 この画像を表示するには、次の 2 つの方法があります。

プロパティが StaticPopOutImageUrl 設定されている場合、そのイメージは、プロパティの値に関係なく、組み込みイメージを StaticEnableDefaultPopOutImage オーバーライドします。

注意

プロパティが StaticPopOutImageUrl 設定されておらず、プロパティが StaticEnableDefaultPopOutImage 設定 falseされている場合、イメージは表示されません。

プロパティを設定することで、画像の代替テキストを StaticPopOutImageTextFormatString 指定できます。

適用対象

こちらもご覧ください