This documentation is archived and is not being maintained.

TreeViewCtl Sample: Demonstrates the Windows Forms TreeView Control

Visual Studio .NET 2003

The TreeViewCtl sample illustrates Windows Forms in a .NET Framework application, focusing on manipulating the properties of TreeView controls:

  • Sorting
  • Hot tracking
  • Display: showing lines, root lines, plus-minus sign, and check boxes
  • Hiding the selection
  • Attaching images
  • Amount of indent

Building and Running the Sample

To build and run TreeViewCtl using Visual Studio

  1. In the Visual Studio IDE, open the solution file TreeViewCtl.sln.
  2. In Solution Explorer, right-click the TreeViewCtl solution.
  3. On the shortcut menu, click Build.
  4. On the Debug menu, click Start.

The application displays a panel containing a TreeView control populated with the names of the folders located at the root of every fixed drive on the system. A group of check boxes, a combo box, and a numeric up-down control are used to change its properties.

Classes and Keywords

This sample demonstrates the following class:

TreeView

This sample demonstrates the following keywords:

TreeView::Sorted; TreeView::Nodes; TreeView::ImageList; TreeView::Add; TreeView::HotTracking; TreeView::ShowLines; TreeView::ShowPlusMinus; TreeView::ShowRootLines; TreeView::CheckBoxes; TreeView::HideSelection; TreeNode::Expand; TreeNode::Nodes

See Also

Managed Extensions for C++ Samples

Show: