When you use a tab key to select a textbox, all text in it is automatically selected. What’s the easiest way to prevent this from happening? (Setting the selection to none in Enter or GotFocus events doesn’t work)
Thanks (-:
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(I’m assuming that you are using WinForms)
What you have said you have already tried does work.
If you handle the Enter event on the text box, you can set the selection to nothing:
This sets the selection to be a zero-length string starting at the end of the text currently in the text box. This is to position the caret at the end of the current text.