System.Windows.Forms.TreeNodeCollection.Remove Method

Removes the specified tree node from the tree node collection.

Syntax

public void Remove (TreeNode node)

Parameters

node
The System.Windows.Forms.TreeNode to remove.

Remarks

When a System.Windows.Forms.TreeNode is removed from the tree node collection, all subsequent tree nodes are moved up one position in the collection.

You can also remove a System.Windows.Forms.TreeNode that you previously added by using the TreeNodeCollection.RemoveAt(int) or TreeNodeCollection.Clear methods.

Note:

Enumerating the collection and removing nodes is not supported.

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