I have a form containing a TextBox in C# which I set to a string as follows:
textBox.Text = str;
When the form is displayed, why does the text in the texbox appear highlighted/selected?
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.
The text box has a
TabIndexof 0 andTabStopset to true. This means that the control will be given focus when the form is displayed.You can either give another control the 0
TabIndex(if there is one) and give the text box a different tab index (>0), or setTabStopto false for the text box to stop this from happening.