Solved

Make textbox "not selectable"

Posted on 2011-09-19
4
1,178 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:knowlton
  • 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: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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
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 …

809 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