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

Set font colour on a disabled TWinControl 1

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi

I have a screen which consists of TEdits and TListBoxes. The screen is either in View or Edit mode.

When in View mode, I set each control's Enabled = false, but this greys the font. The user wants disabled controls to have a grey background but the font to remain black. In Edit mode, the background changes to clwindow. I currently set the background to grey programmatically, is there a way of setting the font colour or will I have to stop the users writing in the controls myself rather than use the Enabled property ?

lou
 
hi Lou

what I used to do in this case is placing all controls on a Panel and just setting the Panel's Enabled property to false. This method doesn't change the color of the Edit fields.

Hope it helps

regards
Rod
 
Excellent, Rod, thanks, that works a treat. I just didn't think of setting the panel.

lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top