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

# TCustomEdit.ClearSelection

Clears the current text selection in the edit control.

## Declaration

Source position: stdctrls.pp line 846

`public procedure TCustomEdit.ClearSelection; virtual;`

## Description

ClearSelection is a procedure used to clear the currently selected text in the edit control. ClearSelection sets the value in SelText to an empty string ('') to discard selected value in the edit control. It does not affect the values in the Text property.

No actions are performed in the method when SelLength contains 0 (zero).

Use HideSelection to disable text selection in the edit control.

## See also

TCustomEdit.SelText |  | The currently selected text in the edit box for the control.
TCustomEdit.SelStart |  | The zero-based index for the first UTF-8 character in the current text selection.
TCustomEdit.SelLength |  | The number of currently selected UTF-8-encoded characters in the control.
TCustomEdit.HideSelection |  | Determines if selected text to be hidden when the control does not have focus.