TreeView.HideSelection 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 a value indicating whether the selected tree node remains highlighted even when the tree view has lost the focus.

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

member HideSelection : bool with get, set

Property Value

Type: System.Boolean

true if the selected tree node is not highlighted when the tree view has lost the focus; otherwise, false. The default is true.

When this property is set to false, selected nodes in the TreeView control remain highlighted in a different color than the current selection color when the TreeView control loses focus. You can use this property to keep items that are selected by the user visible when the user clicks a different control on the form or moves to a different window.

System_CAPS_noteNote

If you are concerned with the accessibility of your applications, it is recommended that you set the HideSelection property to false.

The following code example demonstrates how to use the HideSelection property. To run this example, paste the following code in a form and call the InitializeSelectedTreeView method in the form's constructor or Load event handler.

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

.NET Framework
Available since 1.1
Return to top
Show: