TreeView.LeafNodeStyle Property
Assembly: System.Web (in system.web.dll)
/** @property */ public TreeNodeStyle get_LeafNodeStyle ()
public function get LeafNodeStyle () : TreeNodeStyle
Not applicable.
Property Value
A reference to the TreeNodeStyle that represents the style of the leaf nodes in the TreeView.Use the LeafNodeStyle property to control the appearance of the leaf nodes in the TreeView control. This property is read-only; however, you can set the properties of the TreeNodeStyle object it returns. The properties can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the TreeNodeStyle object (for example, LeafNodeStyle-ForeColor). The properties can also be set programmatically in the form Property.Subproperty (for example, LeafNodeStyle.ForeColor). Common settings usually include a custom background color, foreground color, font properties, and node spacing. Style properties are applied in the following order of precedence:
-
RootNodeStyle, ParentNodeStyle, or LeafNodeStyle, depending on the node type. If the LevelStyles collection is defined, it is applied at this time, overriding the other node style properties.
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.