System.Windows.Forms.TreeNodeCollection.Clear Method

Removes all tree nodes from the collection.

Syntax

public virtual void Clear ()

Remarks

You can use this method to clear the entire collection of tree nodes from a tree view.

To remove an individual tree node from the collection, use the TreeNodeCollection.Remove(TreeNode) or TreeNodeCollection.RemoveAt(int) methods.

To add new System.Windows.Forms.TreeNode objects to the collection, use the TreeNodeCollection.Add(string), TreeNodeCollection.AddRange(TreeNode[]), or TreeNodeCollection.Insert(int, TreeNode) methods.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0