Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something like the Read Only but don't put the text in gray 1

Status
Not open for further replies.

myrgir

Programmer
Feb 7, 2006
62
CA
Hi
Does it have a property or something like this that put a textbox in read only mode without putting the text in gray. I would like the text stay black.
I just don't want the user enter key in that textbox
Thanks in advance
 
I tried it but it doesn't do anything,
It written in the description of the locked property "The Locked property determines if we can move or resize the control"
So it seems like it's not what I'm looking for.
 
How to make a textbox readonly:

1. Set the ReadOnly property to TRUE. By default, the backcolor will change to gray; the forecolor will not be changed (black). If you want change the backcolor back to white.

2. Do it programmatically. E.g. write "e.Handled = True" in the KeyPress event handler. User cannot enter text, UNLESS he uses Cut/Copy/Paste.

3. Do not use a textbox, but a label control. This could fit you if you want to display only.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top