Rediger

Del via


TreeNodeCollection Constructors

Definition

Initializes a new instance of the TreeNodeCollection class.

Overloads

TreeNodeCollection()

Initializes a new instance of the TreeNodeCollection class using the default values.

TreeNodeCollection(TreeNode)

Initializes a new instance of the TreeNodeCollection class using the specified parent node (or owner).

TreeNodeCollection()

Initializes a new instance of the TreeNodeCollection class using the default values.

public:
 TreeNodeCollection();
public TreeNodeCollection ();
Public Sub New ()

Remarks

Use this constructor to initialize a new instance of the TreeNodeCollection class using the default values. This constructor is commonly used when creating a collection of root nodes where a parent node (or owner) is not required.

Note

When creating a collection of non-root nodes, you should use the overloaded constructor that takes the owner parameter, instead of this constructor, to specify the parent node.

This constructor is used primarily by control developers.

See also

Applies to

TreeNodeCollection(TreeNode)

Initializes a new instance of the TreeNodeCollection class using the specified parent node (or owner).

public:
 TreeNodeCollection(System::Web::UI::WebControls::TreeNode ^ owner);
public TreeNodeCollection (System.Web.UI.WebControls.TreeNode owner);
new System.Web.UI.WebControls.TreeNodeCollection : System.Web.UI.WebControls.TreeNode -> System.Web.UI.WebControls.TreeNodeCollection
Public Sub New (owner As TreeNode)

Parameters

owner
TreeNode

The TreeNode object that represents the parent node of the collection.

Remarks

Use this constructor to initialize a new instance of the TreeNodeCollection class using the specified parent node (or owner). This constructor is commonly used when creating a collection of non-root nodes where you need to specify the parent node.

Note

When creating a collection of root nodes, consider using the parameterless constructor because root nodes do not have a parent node.

This constructor is used primarily by control developers.

See also

Applies to