473,396 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to lock the text of the TextBox control?

Hi:

I programmingly created a TextBox control, as:

TextBox tbPublisher = new TextBox();

tbPublisher.ID="thepublisher";

tbPublisher.Text="Quentin";
I don't want others to modify the text of this control, how can I do?

I tried making it be 'readonly', by adding:

tbPublisher.ReadOnly=true;
But the text area will be empty (nothing show up in the text box).

What can I do?

Thanks

Q.

Nov 18 '05 #1
1 1410
Try txtPublisher.Enabled=False

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Quentin Huo" <q.***@manyworlds.com> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Hi:

I programmingly created a TextBox control, as:

TextBox tbPublisher = new TextBox();

tbPublisher.ID="thepublisher";

tbPublisher.Text="Quentin";
I don't want others to modify the text of this control, how can I do?

I tried making it be 'readonly', by adding:

tbPublisher.ReadOnly=true;
But the text area will be empty (nothing show up in the text box).

What can I do?

Thanks

Q.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom | last post by:
I have the following code as part of a procedure in a standard module: Dim ctrl As Control For Each ctrl In MyForm.Controls If ctrl.ControlType = acTextBox Then MsgBox ctrl.name MsgBox...
7
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
0
by: andytsummers | last post by:
Hi I have tried to implement drag and drop by using the following code but I have several problems. 1. When you put your mouse over selected text the cursor is still the i-beam and therefore...
4
by: slinky | last post by:
I have a textbox that a user enters the current time (in this case at the end of a task, and it gets its value via a button's click event and getting its value from =Now() ). Is there a way to...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
10
by: moondaddy | last post by:
I have a textbox on a webform and based on certain conditions I wanted to prevent a user from editing its text. I dont like the look of the texbox when its disabled and was wondering if there is a...
4
by: zacks | last post by:
I'm not sure when it came into being, since this it the first time I have worked very much with a password control in .NET, but if a textbox that has a non-empty value for PasswordChar or the...
2
by: Agnes | last post by:
User request that ' when input the companyname in the textbox' , default the cap lock on. How can I do that ? thanks
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.