SelLength
Property
Applies to
Declaration
property SelLength: Integer;
Description
The SelLength property returns the length (in characters) of the control's selected text. By using SelLength along with the properties to set the edit place you specify which part of the text in the control is selected. Giving a negative value to this property will extend the selection to the left of the current caret position. A positive value will select text to the right of the caret. Likewise, reading this property will return a negative value if the caret is at the end of the selection block, and a positive value if it is at the beginning.
When you write to SelStart or another property to specify the current edit place, SelLength is reset to zero.
Note
SelStart and SelLength behave slightly differently from the similarly named properties of Delphi's native TMemo: in TPlusMemo, SelStart always indicates the current position of the caret (or "editing point"). If the caret is at the end of selection, SelLength will be negative and SelStart will be greater than the position where the selection starts, contrarily to TMemo.