TreeNodeStyle Class
Assembly: System.Web (in system.web.dll)
Use the TreeNodeStyle class to represent the style of a node in the TreeView control. The TreeView control allows you to specify different style characteristics (such as font size and color) for each of the different node types.
The following table lists the node styles that are supported by the TreeNodeStyle class.
| Node style property | Description |
|---|---|
| The style settings for a node when the mouse pointer is positioned over it. | |
| The style settings for the leaf nodes. | |
| The default style settings for a node. | |
| The style settings for the parent nodes. | |
| The style settings for the root node. | |
| The style settings for a selected node. |
When you set the node style properties of the TreeView control, they are applied in the following order:
-
NodeStyle.
-
RootNodeStyle, ParentNodeStyle, or LeafNodeStyle, depending on the node type.
-
SelectedNodeStyle.
-
HoverNodeStyle.
The TreeNodeStyle class inherits most of its members from the Style class. It extends the Style class by providing properties that control the amount of space around the text in a node, as well as the space between adjacent nodes. Use the HorizontalPadding property to control the amount of space to the left and right of the text in a node. Similarly, the VerticalPadding property controls the amount of space above and below the text in a node. You can control the amount of spacing between the node that the TreeNodeStyle is applied to and its adjacent nodes by setting the NodeSpacing property. To control the amount of spacing between a parent node and a child node, use the ChildNodesPadding property.
For more information about the inherited style settings, see Style.
System.MarshalByRefObject
System.ComponentModel.Component
System.Web.UI.WebControls.Style
System.Web.UI.WebControls.TreeNodeStyle
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.