Recent

Author Topic: [Solved] How to unselect the text in a focused TEdit, programmatically  (Read 1875 times)

jamie

  • Hero Member
  • *****
  • Posts: 6787
Re: [Solved] How to unselect the text in a focused TEdit, programmatically
« Reply #15 on: December 01, 2024, 12:48:55 pm »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Edit1Enter(Sender: TObject);
  2. begin
  3.   Exit;
  4.   With TEdit(Sender) do
  5.    Begin
  6.      SelStart := CaretPos.X;
  7.      SelLength := 0;
  8.    end;
  9. end;                            
  10.  
@jamie: anything after exit will not be executed
U r correct. I pasted the wrong code. I placed the exit there as test and forgot to remove it for post.
Shameful sin on my part  :(
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018