TreeView.ExpandImageToolTip 属性
定义
获取或设置可展开节点的指示符所显示图像的工具提示。Gets or sets the ToolTip for the image that is displayed for the expandable node indicator.
public:
property System::String ^ ExpandImageToolTip { System::String ^ get(); void set(System::String ^ value); };
public string ExpandImageToolTip { get; set; }
member this.ExpandImageToolTip : string with get, set
Public Property ExpandImageToolTip As String
属性值
可展开节点的指示符所显示图像的工具提示。The ToolTip for the image displayed for the expandable node indicator.
示例
下面的代码示例演示如何使用 ExpandImageToolTip 属性为可展开节点的指示符显示的图像指定工具提示。The following code example demonstrates how to use the ExpandImageToolTip property to specify a ToolTip for an image that is displayed for the expandable node indicator.
<%@ 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>TreeView Custom Images Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>TreeView Custom Images Example</h3>
<!-- Set the custom images of this TreeView control -->
<!-- declaratively. -->
<asp:TreeView id="CustomTreeView"
NoExpandImageUrl="Space.jpg"
CollapseImageUrl="Minus.jpg"
CollapseImageToolTip="Collapse Node"
ExpandImageUrl="Plus.jpg"
ExpandImageToolTip="Expand Node"
RootNodeStyle-ImageUrl="Root.jpg"
ParentNodeStyle-ImageUrl="Parent.jpg"
LeafNodeStyle-ImageUrl="Leaf.jpg"
ImageSet="Custom"
runat="server">
<Nodes>
<asp:TreeNode Value="Home"
NavigateUrl="Home.aspx"
Text="Home"
Target="_blank"
Expanded="True">
<asp:TreeNode Value="Page 1"
NavigateUrl="Page1.aspx"
Text="Page 1"
Target="_blank">
<asp:TreeNode Value="Section 1"
ImageUrl="custom.jpg"
NavigateUrl="Section1.aspx"
Text="Section 1"
Target="_blank">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Value="Page 2"
Selected="True"
NavigateUrl="Page2.aspx"
Text="Page 2"
Target="_blank">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</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>TreeView Custom Images Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>TreeView Custom Images Example</h3>
<!-- Set the custom images of this TreeView control -->
<!-- declaratively. -->
<asp:TreeView id="CustomTreeView"
NoExpandImageUrl="Space.jpg"
CollapseImageUrl="Minus.jpg"
CollapseImageToolTip="Collapse Node"
ExpandImageUrl="Plus.jpg"
ExpandImageToolTip="Expand Node"
RootNodeStyle-ImageUrl="Root.jpg"
ParentNodeStyle-ImageUrl="Parent.jpg"
LeafNodeStyle-ImageUrl="Leaf.jpg"
ImageSet="Custom"
runat="server">
<Nodes>
<asp:TreeNode Value="Home"
NavigateUrl="Home.aspx"
Text="Home"
Target="_blank"
Expanded="True">
<asp:TreeNode Value="Page 1"
NavigateUrl="Page1.aspx"
Text="Page 1"
Target="_blank">
<asp:TreeNode Value="Section 1"
ImageUrl="custom.jpg"
NavigateUrl="Section1.aspx"
Text="Section 1"
Target="_blank">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Value="Page 2"
Selected="True"
NavigateUrl="Page2.aspx"
Text="Page 2"
Target="_blank">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>
注解
使用 " ExpandImageToolTip 属性" 指定图像的工具提示。Use the ExpandImageToolTip property to specify a ToolTip for the image. 指定的文本为辅助技术设备提供了可用于使控件更易于访问的图像说明。The text that you specify provides Assistive Technology devices with a description of the image that can be used to make the control more accessible.
此属性的值存储在视图状态中。The value of this property is stored in view state.
设置此属性后,可以使用设计器工具自动将此属性的值保存到资源文件中。The value of this property, when set, can be saved automatically to a resource file by using a designer tool. 有关详细信息,请参阅 LocalizableAttribute 和 全球化和本地化。For more information, see LocalizableAttribute and Globalization and Localization.