Solved

c# textbox highligted

Posted on 2011-02-20
5
280 Views
Last Modified: 2013-12-17
Hi,

I don't know how not highlight my textbox since when my form
loaded, for some reason my textbox is highligted.

Thanks,
JT
0
Comment
Question by:jtran007
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
KiasChaos83 earned 250 total points
ID: 34939889
You haven't given much information to go off.. so I'm going to give you the dirty answer:

textbox1.SelectionStart = 0;
textbox1.SelectionLength = 0;

Open in new window

0
 
LVL 9

Expert Comment

by:s_chilkury
ID: 34939945
Do you mean the text inside the textbox is been selected when the form is loaded?
0
 

Author Comment

by:jtran007
ID: 34940232
Hi S_chilkury,

Yes. That's correct.

JT
0
 
LVL 9

Expert Comment

by:s_chilkury
ID: 34940320
The text box has a TabIndex of 0 and TabStop set 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 set TabFocus to false for the text box to stop this from happening.
0
 

Author Closing Comment

by:jtran007
ID: 34940323
Thanks,
JT
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now