Export (0) Print
Expand All
Expand Minimize

Code: Adding Nested Nodes to a TreeView Control (Visual C#)

Visual Studio .NET 2003

This example adds a first-level node and a second-level node to an existing TreeView control.

Example

TreeNode node = treeView1.Nodes.Add("Level one node");
node.Nodes.Add("Level two node");

Compiling the Code

This example requires:

  • A TreeView control named treeView1.

See Also

Windows Forms Example Topics | Code: Adding a Node to the Selected Node of a TreeView Control (Visual C#) | Code: Adding Nodes to a TreeView Control (Visual C#) | TreeView.Nodes Property | TreeView Control (Windows Forms)

Show:
© 2014 Microsoft