Recent

Author Topic: [SOLVED] Edit and text Highlights  (Read 408 times)

superc

  • Full Member
  • ***
  • Posts: 241
[SOLVED] Edit and text Highlights
« on: April 29, 2022, 09:48:15 am »
Hello,

I have a stupid problem that I can't solve; in my program I've a edit for search and when user insert a text start a timer of 500ms and if user enter new keys timer stop and restart: when timer execute onTimer events, edit lose focus and after with setfocus all text are highlighed as in the image;

how can I solve the problem?

Thanks in advance.
« Last Edit: April 29, 2022, 09:58:47 am by superc »

dseligo

  • Hero Member
  • *****
  • Posts: 1180
Re: Edit and text Highlights
« Reply #1 on: April 29, 2022, 09:54:26 am »
After SetFocus add something like this:
Code: Pascal  [Select][+][-]
  1. YourEditName.SelStart := Length(YourEditName.Text);
  2. YourEditName.SelLength := 0;
  3.  

superc

  • Full Member
  • ***
  • Posts: 241
Re: Edit and text Highlights
« Reply #2 on: April 29, 2022, 09:58:32 am »
Works fine, Thank you.

 

TinyPortal © 2005-2018