TreeView.ItemHeight Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the height of each tree node in the tree view control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member ItemHeight : int with get, set

Property Value

Type: System.Int32

The height, in pixels, of each tree node in the tree view.

Exception Condition
ArgumentOutOfRangeException

The assigned value is less than one.

-or-

The assigned value is greater than the MaxValue value.

If the item height is set to a value larger than the height of the tree view control, calling the TreeNode.EnsureVisible method will have unexpected results.

The following code example changes the size NodeFont to the specified size and adjusts the ItemHeight of the tree node's parent TreeView control. This example requires that you have a Form with a TreeView control with a collection of TreeNode objects, and a ComboBox that contains font sizes.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: