System.Web.UI.WebControls Namespace TreeView Class
.NET Framework version 2.0
Sets or retrieves the style properties for leaf nodes in a TreeView control.
Script |
TreeView.LeafNodeStyle.Property [ = enumValue ] |
A TreeNodeStyle object that defines the style properties for leaf nodes in a TreeView.
Use the LeafNodeStyle property to specify the appearance of leaf nodes in a TreeView control. Common style attributes that can be set include forecolor, backcolor, font, and content alignment within the tree. Providing different node styles enhances the appearance of the TreeView control.
The LeafNodeStyle subproperties can be set declaratively using either of the following methods:
The subproperties can also be set programmatically in the form LeafNodeStyle.Property.
Style properties are applied in the following order of precedence:
If you need to generate table of contents-style navigation menus where nodes at a certain level should have the same appearance, regardless of whether they have child nodes, you might consider using the LevelStyles property instead of setting the individual style properties.
For a list of style properties that can be set, see the TreeNodeStyle class.
TreeView Members