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

# TTreeNodes.ClearMultiSelection

Clears the nodes in a multi-selection and optionally the selected node on the tree view control.

## Declaration

Source position: comctrls.pp line 3287

`public procedure TTreeNodes.ClearMultiSelection(`
`ClearSelected: Boolean = False`
`);`

## Arguments

`ClearSelected` |  | True to clear the Selected property on the tree view control.

## Description

ClearMultiSelection is a method used to remove the internal node references used for a multi-selection range in the container. Each node in the range sets its MultiSelected property to False to remove it from the selection range. The GetNextMultiSelected method for the tree node is called to get the next node in the multi-selection. The process is repeated until there are no more nodes with their MultiSelected properties enabled.

The ClearSelected argument indicates whether the Selected node in the tree view control is cleared. When set to True, the Selected property in the Owner is set to Nil. The default value for the argument is False.

Updates to the multi-selection range are enclosed by calls to the LockSelectionChangeEvent and UnlockSelectionChangeEvent methods in the Owner control (when assigned). This prevents selection change events on the tree view control while the method is active.

## See also

TTreeNode.MultiSelected |  | Indicates whether the node is one of several nodes selected simultaneously (e.g. using the Shift or Ctrl key while selecting on a tree view control).
TTreeNode.GetNextMultiSelected |  | Returns the next tree node which is included in a multi-selected range of nodes.
TCustomTreeView.Selected |  | The selected tree node in the control.
TCustomTreeView.LockSelectionChangeEvent |  | Increments the internal counter used to lock selection change events for the control.
TCustomTreeView.UnlockSelectionChangeEvent |  | Decrements the internal counter used to lock selection change events for the control.