Back to Devexpress

TcxCustomTextEdit.SetSelection(Integer,Integer) Method

vcl-cxtextedit-dot-tcxcustomtextedit-dot-setselection-x28-system-dot-integer-system-dot-integer-x29.md

latest1.7 KB
Original Source

TcxCustomTextEdit.SetSelection(Integer,Integer) Method

Sets the text selection within a text editor.

Declaration

delphi
procedure SetSelection(ASelStart: Integer; ASelLength: Integer);

Parameters

NameType
ASelStartInteger
ASelLengthInteger

Remarks

Each text editor allows a user to select any portion of text using the cursor keys. The selected characters are highlighted and can be copied by Ins key to clipboard, deleted by Del key or replaced by another character entered. You can use the SetSelection method to set the text selection within a text editor. SetSelection sets the SelStart and SelLength properties to values passed as ASelStart and ASelLength parameters respectively. This sets the selection for the text portion starting from the ASelStart position. The ASelLength parameter specifies the number of characters to select. Setting ASelLength to 0 removes the selection.

To select all the text, use the SelectAll method.

See Also

TcxCustomTextEdit.SelectAll

TcxCustomTextEdit.SelLength

TcxCustomTextEdit.SelStart

TcxCustomTextEdit.SelText

TcxCustomTextEdit Class

TcxCustomTextEdit Members

cxTextEdit Unit