Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomTextEdit.SetSelection(Integer,Integer) Method

Sets the text selection within a text editor.

#Declaration

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

#Parameters

Name Type
ASelStart Integer
ASelLength Integer

#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