Solved

c# textbox highligted

Posted on 2011-02-20
5
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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