Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/add-and-remove-nodes-with-wf-treeview-control-using-the-designer.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.4 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
Add and Remove Nodes with TreeView Control Using the Designer 03/30/2017
examples [Windows Forms], TreeView control
TreeView control [Windows Forms], removing nodes
tree nodes in TreeView control
TreeView control [Windows Forms], adding nodes
35bf1750-045e-4ec5-97cb-b47b0dbdaa2c

How to: Add and Remove Nodes with the Windows Forms TreeView Control Using the Designer

Because the Windows Forms xref:System.Windows.Forms.TreeView control displays nodes in a hierarchical manner, when adding a node you must pay attention to what its parent node is.

The following procedure requires a Windows Application project with a form containing a xref:System.Windows.Forms.TreeView control. For information about setting up such a project, see How to: Create a Windows Forms application project and How to: Add Controls to Windows Forms.

To add or remove nodes in the designer

  1. Select the xref:System.Windows.Forms.TreeView control.

  2. In the Properties window, click the Ellipsis (The Ellipsis button (...) in the Properties window of Visual Studio.) button next to the xref:System.Windows.Forms.TreeView.Nodes%2A property.

    The TreeNode Editor appears.

  3. To add nodes, a root node must exist; if one does not exist, you must first add a root by clicking the Add Root button. You can then add child nodes by selecting the root or any other node and clicking the Add Child button.

  4. To delete nodes, select the node to delete and then click the Delete button.

See also