Solved

Make textbox "not selectable"

Posted on 2011-09-19
4
1,225 Views
Last Modified: 2012-05-12
I have some code in place to make a textbox look more like a label (sort of a "read only" status, of sorts).

 tbFirstName.BorderWidth = 0;
 tbFirstName.ReadOnly = true;

But, I can still put an insertion point next to the text.

See my screencast.  Notice around time index :34 seconds, I click next tot he W and it seems to put an  insertion point next to the W  (   W  |    ) but of course you cannot change the W by typing or anything, it still looks odd.

Thank you,

Tom
knowlton-501450.flv
0
Comment
Question by:Tom Knowlton
[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
4 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 475 total points
ID: 36563263
set the Enabled property to False
0
 
LVL 9

Expert Comment

by:BlueYonder
ID: 36563291
Try the enabled tag.  Here is an example.
<asp:TextBox runat="server" ID="txtSomething" CssClass="textEntry" Enabled="false"></asp:TextBox>
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 36563294
If I do that, do I still need to bother with ReadOnly?
0
 
LVL 9

Assisted Solution

by:BlueYonder
BlueYonder earned 25 total points
ID: 36563301
Readonly is not required when enabled is set to false
0

Featured Post

Industry Leaders: 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…

734 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