TreeNodeCollection.IList.Add Method (Object)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

Adds an object to the end of the tree node collection.

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

int IList.Add(
	object node


Type: System.Object

The object to add to the tree node collection.

Return Value

Type: System.Int32

The zero-based index value of the TreeNode that was added to the tree node collection.

Exception Condition

node is currently assigned to another TreeView control.


node is null.

If node is not a TreeNodeCollection, the IList.Add method will use the string returned by the ToString method of the TreeNode class.

.NET Framework
Available since 1.1
Return to top