Autoselect textbox contet

  • Thread starter Thread starter Rafael Pivato
  • Start date Start date
R

Rafael Pivato

How can I autoselect a TextBox text when the user taps it ?

I tried handling the GotFocus event and using SelectAll function, but the
text selects and deselects...
 
Set a short one-shot timer in GotFocus event - something like 100-200 ms
would do. On timer event select all text.
 
Rafael,

I was never able to get SelectAll to do what I wanted either, so I ended up
just setting the textbox Text = "" when it gets focus. That's not the same
thing, of course, but it works the same for my users.
 
Thanks Alex!



What coincidence!!! I recently tried id with a thread and invoke as a "last
try". Not to good.

Using the complete framework with a Windows Forms Application it would work
just by this way too?



Alex Feinman said:
Set a short one-shot timer in GotFocus event - something like 100-200 ms
would do. On timer event select all text.
 
Back
Top