Menu.StaticPopOutImageTextFormatString 属性

定义

获取或设置用于指示静态菜单项包含子菜单的弹出图像的替换文字。

public:
 property System::String ^ StaticPopOutImageTextFormatString { System::String ^ get(); void set(System::String ^ value); };
public string StaticPopOutImageTextFormatString { get; set; }
member this.StaticPopOutImageTextFormatString : string with get, set
Public Property StaticPopOutImageTextFormatString As String

属性值

String

弹出图像的替换文字。 默认值为空字符串 (""),表示尚未设置此属性。

示例

下面的代码示例演示如何使用 StaticPopOutImageTextFormatString 属性指定用于指示静态菜单项具有子菜单的图像的备用文本。 当用户将鼠标指针放置在图像上时,此文本显示为工具提示。


<%@ 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 StaticPopoutImageText and StaticPopoutImageUrl Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticPopoutImageText and StaticPopoutImageUrl Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="1"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"
        StaticPopOutImageTextFormatString="More..."
        staticpopoutimageurl="Images/Popout.jpg"   
        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 StaticPopoutImageText and StaticPopoutImageUrl Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>Menu StaticPopoutImageText and StaticPopoutImageUrl Example</h3>
    
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="1"
        staticsubmenuindent="10" 
        orientation="Vertical"
        target="_blank"
        StaticPopOutImageTextFormatString="More..."
        staticpopoutimageurl="Images/Popout.jpg"   
        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>

注解

当静态菜单项包含子菜单时,可以显示图像以指示用户可以展开菜单。 使用该 StaticPopOutImageTextFormatString 属性指定此图像的备用文本。

可通过两种方式显示图像:

备注

此属性适用于内置映像和自定义映像。

适用于

另请参阅