labeledcombobox SetSelection method
Return to Introduction  Previous page  Next page
Applies to
acEdit, acNumberEdit, acMRUComboBox, acLabeledComboBox and acTreeComboBox components.  

Declaration
procedure SetSelection(SelStart: Integer = 0; SelEnd: Integer = -1);  

Description
The SetSelection method used to select a range of characters in an edit control.  
 
SelStart parameter specifies the starting character position of the selection.  
 
SelEnd parameter specifies the ending character position of the selection.  

Remarks
If the SelStart parameter is 0 and the SelEnd parameter is -1, all the text in the edit control is selected. If SelStart is -1, any current selection is removed. The caret is placed at the end of the selection indicated by the greater of the two values SelEnd and SelStart.