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

Changing Color property for Disable controls

Status
Not open for further replies.

arbo80

Programmer
Jan 5, 2006
53
US
Hi,

I have textboxes, drop down lists and radio buttoms. I disabled them obviously it's all grey out now. I would like to change the forecolor but txt.forecolor = Color.Black doesn't work. Is there any way I can change that? Any suggestions?

Thanks
Armel
 
Once you disable a control you can no-longer visually see background and foreground color changes until you re-enable the control.

to get around this, you are better off to either:

Not disable the control but prevent index changes, text input, or clicks by capturing their events and deeming them "Handled".

or

Extend the control in your own class and perform the GDI+ drawing yourself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top