System.Windows.Forms.TreeNodeCollection.RemoveAt Method

Removes a tree node from the tree node collection at a specified index.

Syntax

public virtual void RemoveAt (int index)

Parameters

index
The index of 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.Remove(TreeNode) 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