TreeView.Sorted 属性
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,用以指示树视图中的树节点是否经过排序。
public:
property bool Sorted { bool get(); void set(bool value); };
C#
public bool Sorted { get; set; }
C#
[System.ComponentModel.Browsable(false)]
public bool Sorted { get; set; }
member this.Sorted : bool with get, set
[<System.ComponentModel.Browsable(false)>]
member this.Sorted : bool with get, set
Public Property Sorted As Boolean
如果树视图中的树节点经过排序,则为 true
;否则为 false
。 默认值为 false
。
- 属性
true
设置为时Sorted,TreeNode对象按属性值按字母顺序Text排序。 向排序TreeView添加大量项目时,应始终使用BeginUpdate和维护EndUpdate性能。 更改现有节点的文本时,必须调用 Sort 以采用项。
备注
默认排序器 Compare 使用基于 CurrentCulture 应用程序指定的方法。 这意味着 TreeNode ,具有相等值的对象按添加到 TreeView 控件的顺序保留。
产品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |