TreeViewDrawMode Enumeration
Defines constants that represent the ways a TreeView can be drawn.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
| Member name | Description | |
|---|---|---|
| Normal | The TreeView is drawn by the operating system. | |
| OwnerDrawAll | All elements of a TreeView node are drawn manually, including icons, checkboxes, plus and minus signs, and lines connecting the nodes. | |
| OwnerDrawText | The label portion of the TreeView nodes are drawn manually. Other node elements are drawn by the operating system, including icons, checkboxes, plus and minus signs, and lines connecting the nodes. |
This enumeration is used by the TreeView.DrawMode property to indicate whether the nodes or node-labels of a TreeView are owner-drawn. For more information, see the TreeView.DrawNode event.
The following code example demonstrates how to customize a TreeView control using its owner-draw capability. The TreeView control in the example displays optional node tags alongside the standard node labels. Node tags are specified using the TreeNode.Tag property. The TreeView control also uses custom colors, including a custom highlight color.
You can customize most of the TreeView colors by setting color properties, but the selection highlight color is not available as a property. Additionally, the default selection highlight rectangle extends only around a node label. Owner drawing must be used to draw the node tags and to draw a customized highlight rectangle large enough to include a node tag.
For the complete example, see the TreeView.DrawNode reference topic.
Available since 2.0