[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 3756

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

  

Event handler signalled before the selected node in the tree view control is changed.

TCustomTreeView.OnChange

  

Event handler for a change notification in the tree view control.

TCustomTreeView.OnExpanding

  

Event handler signalled prior to expanding a node on the tree view control.

TCustomTreeView.OnExpanded

  

Event handler signalled when a node on the tree view control 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.


Version 3.2 Generated 2024-02-25 Home