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

# TCustomTreeView.Select

Makes the specified node(s) become selected in the control.

## Declaration

Source position: comctrls.pp line 3739

`public procedure TCustomTreeView.Select(`
`Node: TTreeNode;`
`ShiftState: TShiftState = []`
`); procedure TCustomTreeView.Select(`
`const Nodes: array of TTreeNode`
`); virtual; procedure TCustomTreeView.Select(`
`Nodes: TList`
`); virtual;`

## Arguments

`Node` |  | Tree node assigned to Selected in the method.
`ShiftState` |  | Shift state for the selection; Shift assumes multi-selection is enabled.

## Arguments

`Nodes` |  | Array or TList with TTreeNode instances to add to the Selections in the control; assumes multi-select is enabled.

## Arguments

`Nodes` |  | Array or TList with TTreeNode instances to add to the Selections in the control; assumes multi-select is enabled.

## Description

Select is an overloaded method used to make a node, array of nodes, or list of nodes become selected in the tree view control.

The overloaded variant with a TShiftState value allows the specified node to be added to the existing multi-selection when Shift contains ssCtrl. If Shift does not include ssCtrl, ClearSelections is called prior to storing the node in Selected.

The variants which accept either an array or a list of nodes always call ClearSelections to reset the selected state for multi-selected nodes. The first TTreeNode instance in either is stored in Selected. When tvoAllowMultiSelect has been included in Options, the Selected property in each of the tree nodes is set to True.

Use ClearSelections to reset the state for any selected nodes on the tree view control.