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

# TCustomEdit.SelLength

The number of currently selected UTF-8-encoded characters in the control.

## Declaration

Source position: stdctrls.pp line 873

`public property TCustomEdit.SelLength : Integer read GetSelLength write SetSelLength;`

## Description

SelLength is an Integer property which contains the number of UTF-8-encoded characters currently selected in the edit box for the control. The current selection is the value in Text starting at the ordinal position in SelStart and continuing for the number of characters in the property.

The value for the property is read from the widgetset class when a handle has been allocated for the control. Otherwise, the internal member is read get the value for the property. Setting a new value for the property notifies the widgetset class when a handle has been allocated for the control.

Use SelStart to set the zero-based position in Text for the first UTF-8-encoded character in the current text selection.

Use SelText to examine the values selected in the control, or to replace the value in the current text selection. ClearSelection can be used to remove the characters in the current text selection for the control.

Use SelectAll to make all values in Text the current text selection in the control.

Use HideSelection to un-select the current text selection in the 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.SelectAll |  | Selects the entire text in the edit control.
TCustomEdit.HideSelection |  | Determines if selected text to be hidden when the control does not have focus.
TCustomEdit.ClearSelection |  | Clears the current text selection in the edit control.