3
I have a very basic problem and I can’t figure out the cause... I need the text from within a Tedit to be whole selected when the field receives focus. In the times of Delphi 7 with VCL I was only doing TEdit(Sender).SelLength := Length(TEdit(Sender).Text)
at the event OnEnter
. Now with Delphi 10.2 and Firemonkey I’ve tried several different ways, but it doesn’t work.
Example:
procedure TfPrincipal.Edit1Enter(Sender: TObject);
begin
TEdit(Sender).SetFocus;
TEdit(Sender).SelStart := 0; // Ja tentei mudar este valor
TEdit(Sender).SelLength := Length(TEdit(Sender).Text); // Ja tentei mudar este valor também
end;
In Firemonkey it works different?
I took the test and it really doesn’t work. see the answer.
– Edu Mendonça