System.Windows.Forms.TreeNodeCollection.Insert Method

Creates a tree node with the specified text and inserts it at the specified index.

Syntax

public virtual TreeNode Insert (int index, string text)

Parameters

index
The location within the collection to insert the node.
text
The text to display in the tree node.

Returns

The System.Windows.Forms.TreeNode that was inserted in the collection.

Remarks

If the TreeView.Sorted property is set to true, the index parameter value is ignored. The System.Windows.Forms.TreeNode is inserted into the tree view and the System.Windows.Forms.TreeView is sorted again.

You can also add new System.Windows.Forms.TreeNode objects to the collection by using the erload:System.Windows.Forms.TreeNodeCollection.Add or TreeNodeCollection.AddRange(TreeNode[]) methods.

Requirements

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