System.Windows.Forms.DrawTreeNodeEventArgs Class

Provides data for the TreeView.DrawNode event.

See Also: DrawTreeNodeEventArgs Members

Syntax

public class DrawTreeNodeEventArgs : EventArgs

Remarks

Use the TreeView.DrawNode event to customize the appearance of nodes in a System.Windows.Forms.TreeView control using owner drawing.

The TreeView.DrawNode event is raised by a System.Windows.Forms.TreeView control when its TreeView.DrawMode property is set to TreeViewDrawMode.OwnerDrawAll or TreeViewDrawMode.OwnerDrawText and a node is displayed or updated. The System.Windows.Forms.DrawTreeNodeEventArgs passed to the event handler contains information about the node to draw as well as providing methods to help you draw the node.

Use the DrawTreeNodeEventArgs.State or DrawTreeNodeEventArgs.Node properties to retrieve information about the node to draw. Use the DrawTreeNodeEventArgs.Graphics property to do the actual drawing within the area specified by the DrawTreeNodeEventArgs.Bounds property. To make the operating system draw a node that does not need to be owner drawn, set the DrawTreeNodeEventArgs.DrawDefault property to true.

When the TreeView.DrawMode property is set to TreeViewDrawMode.OwnerDrawText, the area indicated by the DrawTreeNodeEventArgs.Bounds property includes the label portion of the node only. When the TreeView.DrawMode property is set to TreeViewDrawMode.OwnerDrawAll, the DrawTreeNodeEventArgs.Bounds area includes the entire node, including the area typically used for icons, checkboxes, plus and minus signs, and lines connecting the nodes.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0