TreeViewImageSet 枚举

定义

表示要在 TreeView 控件中使用的图像集。Represents an image set to use in the TreeView control.

public enum class TreeViewImageSet
public enum TreeViewImageSet
type TreeViewImageSet = 
Public Enum TreeViewImageSet
继承
TreeViewImageSet

字段

Arrows 10

预定义的箭头图像集。A predefined set of arrow images.

BulletedList 6

预定义的菱形项目符号图像集。A predefined set of diamond-shaped bullet images.

BulletedList2 7

预定义的方形项目符号图像集。A predefined set of square-shaped bullet images.

BulletedList3 8

预定义的、分节的菱形项目符号图像集。A predefined set of sectioned, diamond shaped bullet images.

BulletedList4 9

预定义的、大小随级别不同而变化的、分节的备用菱形项目符号图像集。A predefined set of alternate sectioned, diamond shaped bullet images in sizes that vary by level.

Contacts 12

预定义的 MSN Messenger 样式的图像集。A predefined set of MSN Messenger-styled images.

Custom 0

用户定义的图像集。A user-defined set of images. 这是 ImageSet 的默认值。This is the default value of the ImageSet.

Events 14

预定义的事件日志样式的图像集。A predefined set of event log-styled images.

Faq 15

预定义的 FAQ 样式的图像集。A predefined set of FAQ-styled images.

Inbox 13

预定义的电子邮件样式的图像集。A predefined set of email-styled images.

Msdn 2

预定义的 Microsoft MSDN 开发程序样式的图像集。A predefined set of Microsoft MSDN developer program-styled images.

News 11

预定义的新闻组样式的图像集。A predefined set of newsgroup-styled images.

Simple 4

预定义的简单空心形状的图像集。A predefined set of simple-shaped outline images.

Simple2 5

预定义的简单实心形状的图像集。A predefined set of filled simple-shaped images.

WindowsHelp 3

预定义的 Microsoft Windows 帮助样式的图像集。A predefined set of Microsoft Windows Help-styled images.

XPFileExplorer 1

预定义的 Microsoft Windows XP Windows 资源管理器样式的图像集。A predefined set of Windows Explorer for Microsoft Windows XP-styled images.

示例

下面的示例演示如何使用TreeViewImageSet枚举来指示要TreeView在控件中使用的图像集:The following example demonstrates how to use the TreeViewImageSet enumeration to indicate which image set to use in the TreeView control:


<%@ 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 ImageSet Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView ImageSet Example</h3>
    
      <asp:TreeView id="LinksTreeView"
         ImageSet="XPFileExplorer" 
         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="Page1"
              Target="_blank">
               
              <asp:TreeNode Value="Section 1" 
                NavigateUrl="Section1.aspx" 
                Text="Section 1"
                Target="_blank"/>
                 
            </asp:TreeNode>              
            
            <asp:TreeNode Value="Page 2" 
              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 ImageSet Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>TreeView ImageSet Example</h3>
    
      <asp:TreeView id="LinksTreeView"
         ImageSet="XPFileExplorer" 
         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="Page1"
              Target="_blank">
               
              <asp:TreeNode Value="Section 1" 
                NavigateUrl="Section1.aspx" 
                Text="Section 1"
                Target="_blank"/>
                 
            </asp:TreeNode>              
            
            <asp:TreeNode Value="Page 2" 
              NavigateUrl="Page2.aspx"
              Text="Page 2"
              Target="_blank">
               
            </asp:TreeNode> 
            
          </asp:TreeNode>
        
        </Nodes>
        
      </asp:TreeView>

    </form>
  </body>
</html>

注解

枚举用于表示可TreeView在控件中显示的不同图像集。 TreeViewImageSetThe TreeViewImageSet enumeration is used to represent the different sets of images that can be displayed in the TreeView control. 可以从预定义的一组映像中进行选择, 也可以通过将TreeView.ImageSet属性设置Custom为值来创建自己的自定义集。You can select from a predefined set of images or create your own custom set by setting the TreeView.ImageSet property to the Custom value. 定义一组自定义图像时, 应该为下表中的每个属性指定一个映像。When defining a custom set of images, you should specify an image for each of the properties in the following table. 否则, 将使用该属性的默认图像。Otherwise, the default image for that property is used.

PropertyProperty 说明Description
CollapseImageUrl 折叠节点的指示符的自定义图像的 URL。The URL to a custom image for the collapsed node indicator.
ExpandImageUrl 展开节点的指示符的自定义图像的 URL。The URL to a custom image for the expanded node indicator.
LineImagesFolder 包含连接节点连线的自定义图像的文件夹的 URL。The URL to a folder that contains custom images for lines-connecting nodes.
NoExpandImageUrl 非展开节点指示符的自定义图像的 URL。The URL to a custom image for the non-expanding node indicator.

适用于

另请参阅