Sign in Join
FPDoc Onlineexperiment

TTreeNode.Enabled property

Member of TTreeNodepublicIn unit ComCtrls

Controls whether the tree node can be selected, and its visual appearance.

Declaration

pascal
property Enabled: Boolean read GetEnabled write SetEnabled default True;

Description

Enabled is a Boolean property which indicates if the tree node can be selected in a tree control. The Selected and MultiSelected properties cannot be set to True when Enabled is False. A mouse click used to select the node is also ignored when Enabled is False. The default value for the property is True.

Read and write access to the property value are redirected to the States property. Enabled is True when nsEnabled is included in the States property. It is False if the value is omitted from States.

Changing the property value causes States to be updated to include or exclude nsEnabled as needed. Selected is set to False for any change to the property value, and the Update method is called to redrawn the Node on the tree view control. The Changed method is called to notify the tree view control of the reason for the update (ncEnablement).

Enabled also affects the visual display for the tree node. When set to False, the text for the node is drawn using either the DisabledFontColor (when assigned) or theme element details for the tree view control.

A tree node can still be expanded (if it has child nodes) even when Enabled is False.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.