In a Windows 11 VCL Application in Delphi 12.1, I have a TSearchBox
. I want to auto-select the SaerchBox text when the SearchBox is focused. I have tried the following:
- Set
AutoSelect
to True at design time:
-
Selecting the SearchBox text at run time:
begin SearchBoxMain.SelStart := 0; SearchBoxMain.SelLength := Length(SearchBoxMain.Text) - 1; SearchBoxMain.SelectAll; end;```
Unfortunately, the SearchBox text is not selected.