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

Changing text color in a disabled text box

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
Is there a way to change the color of a disabled text boxes text? I want to disable textboxes but update them in the coding, but the combo of darker background and the grey text are tough to read.
 
Are the text boxes always disabled? If so consider using a label made to look like a text box. (Adjust the .appearance, .backstyle and .borderstyle properties).

Otherwise you can keep it enabled and just lock it so it cannot be edited (.locked = true). The only thing I don't like with the second option is that the textbox can still recieve focus.

zemp
 
Don't think you can. When disabled they look dead. Only other way off the top of my head is to put the group of Buttons in a Picture box, and disable the picturebox. They however look enabled, and as you cannot (think) change the text forecolor, you will only be able to change the backcolor.

However whilst writing, if you want color changes, then you can use an option button, setting one of its properties graphical. I will look at it and come back, or someone else can comment. Regards
 
the textboxes are going to be disabled on and off. Requiring people to enter differnet values and if it isnt enabled the text box is going to be updated through the code. I guess I can always just change the backcolor of the textbox. Was just wondering if someone might know a way. Thanks for the responses
 
Re Option box. If you set its Style property to Graphical it will look loke a button. If you put a line in the on click event, Option1.Value=False, then when its pressed it will pop back out again like a command button. You can change the text color. If it was on a picturebox, and that was disabled together with a color choice for the text it would work. Only has an advantage if several buttons are disabled at sam time, and are near each other to reduce/ease use of picture box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top