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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Color of a Disabled TextBox? 1

Status
Not open for further replies.

wraygun

Programmer
Dec 9, 2001
272
US
Hey there,

Anyone know how to change the textcolor of a disabled textbox?

for example:

Black background w/ Yellow Font

Thanks in advance.

Wraygun
 
Hi Wraygun,
Text1.Enabled = False
Text1.BackColor = vbBlack
Text1.ForeColor = vbYellow
This will do what you want but when a control is set to Enabled = False it dulls the color and the yellow goes pale. To have a better yellow you will need to find a color that turns yellow when faded.

I hope this helps

Gazzza
 
Thanks Gazzza,

I attempted the above code, but to no avail. No matter what color I seem to set the foreground to for the textbox, it's always the same gray color when it's disabled.

Any other ideas?

Thanks again,
Wraygun
 
If all you want is to not allow modification of the text box contents by the user then you might want to use the .Locked property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top