Solved

c# textbox highligted

Posted on 2011-02-20
5
283 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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 …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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