TreeView.Sorted 屬性

定義

取得或設定值,指出是否排序樹狀檢閱中的樹狀節點。

public:
 property bool Sorted { bool get(); void set(bool value); };
public bool Sorted { get; set; }
[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

屬性值

Boolean

如果樹狀檢視中的樹狀節點已排序,則為 true,否則為 false。 預設為 false

屬性

備註

當 設定為 trueSorted ,物件 TreeNode 會依屬性值 Text 依字母順序排序。 當您將大量專案新增至已 TreeView 排序 時,應該一律使用 BeginUpdateEndUpdate 來維護效能。 當現有節點的文字變更時,您必須呼叫 Sort 以叫用專案。

注意

預設排序器會 Compare 根據 CurrentCulture 應用程式所指定的 使用 方法。 這表示 TreeNode 具有相等值的物件會依加入 TreeView 控制項的順序保留。

適用於