|
Making
a Text Box read only
Often times I have come across
situations where I would want to make a
read only text box. It would need
to behave like a picture box. The
problem is if you make the textbox
disabled the text in the box will turn
gray no matter what you set the color
property to be. If you make it
locked you can still put the cursor
inside the text box but you will not be
able to edit the text. The solution
is to create a picture box that has no
border. (So that it will be invisible).
Next, you put the text box inside the
picture box. You then set the
picture box's enabled property to
false. This will allow the text box
to be read only. If you then want
the text box to be enabled, set the
picture box enabled property to true.
|
|
|
|