[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'ComCtrls' (#lcl)

TCustomTreeView.Selected

The selected tree node in the control.

Declaration

Source position: comctrls.pp line 3722

public property TCustomTreeView.Selected : TTreeNode
  read GetSelection
  write SetSelection;

Description

Selected is a TTreeNode property which contains the selected tree node in the control. A tree node is selected when the Left or Right mouse button is clicked on the code. It can also be selected by assigning a TTreeNode instance to the property.

When a tree node is selected or unselected, the Selected property in the TTreeNode instance is updated. Use the OnChanging event handler to determine if a specific tree node can become the selected node in the control. Use the OnChange event handler to perform actions needed after the tree node is made the Selected node in the control.

Selecting a tree node forces it to become fully visible in the control. This includes expanding parent nodes to ensure that the node is visible. The OnExpanding and OnExpanded event handlers are signalled before and after actions to a given tree node.

Use the Selections property to access the list of selected tree nodes when multi-selection has been enabled in the Options for the control. Use the SelectionCount property to get the number of tree nodes in the Selections property.

See also

TCustomTreeView.OnChanging

  

OnChanging - specialized event handler while TreeView is being changed.

TCustomTreeView.OnChange

  

OnChange - specialized event handler for a change in the TreeView.

TCustomTreeView.OnExpanding

  

OnExpanding - specialized event handler while a TreeView is being expanded.

TCustomTreeView.OnExpanded

  

OnExpanded - specialized event handler when a TreeView has been expanded.

TCustomTreeView.Selections

  

Provides indexed access to the multi-selected tree nodes in the control.

TCustomTreeView.SelectionCount

  

Number of selected nodes in the tree view.

TCustomTreeView.Options

  

The set of options enabled in the tree view control.

TTreeNode.Selected

  

True if the current node is selected in the tree view control.