Board index » delphi » How to change the default text Color from Grey another color( clBlack ) for a disabled control

How to change the default text Color from Grey another color( clBlack ) for a disabled control

Does anyone know how to change the default disabled text color from grey to
black for an entire application ? In my application - when the data in  a
form or frame is not editable I loop through all of the wincontols in the
Form/Frame and disable them with the exception of those with a read-only
property. As a result, some of the components on the Form  or Frame appear
disabled ( with the Font Greyed ) while other components maintain their
black font color. Needless to say this creates an interesting visual effect
( one to be avoided) and makes the text difficult to read. I would like to
have all components to appear enabled ( without the Geyed text )
irregardless of whether they are disabled or not. I've tried several
approaches to this dilemma but none has worked appropriately. I thought that
intercepting the WM_PAINT message would allow me to change the components
font color but it appears that I cannot ascertain which component and class
I'm dealing with within the WM_PAINT message. If anyone has any experience
with this I would appreciate hearing from you on how you resolved the
problem. I have Delphi 6.0. Thanks,
 

Re:How to change the default text Color from Grey another color( clBlack ) for a disabled control


Put all the controls on a panel and disable the panel, leave the enabled
property of the controls alone.

Re:How to change the default text Color from Grey another color( clBlack ) for a disabled control


Thanks, it appears to work correctly. Do you have any ideas on how I might
handle TMemos / TRichedits or any control that might have text located
outside of the visible window. When I disable the frame I lose the ability
to scroll text into view. Thanks again - I had not considered trying to do
this the easy way(your way).
Quote
"Bruce Roberts" <b...@bounceitattcanada.xnet> wrote in message

news:diwk9.13357$H67.63335@tor-nn1.netcom.ca...
Quote
> Put all the controls on a panel and disable the panel, leave the enabled
> property of the controls alone.

Re:How to change the default text Color from Grey another color( clBlack ) for a disabled control


Quote
"EZEKIEL BRADLEY" <zebra...@prodigy.net> wrote in message

news:JGgl9.599$V01.32739448@newssvr15.news.prodigy.com...

Quote
> Thanks, it appears to work correctly. Do you have any ideas on how I might
> handle TMemos / TRichedits or any control that might have text located
> outside of the visible window. When I disable the frame I lose the ability
> to scroll text into view. Thanks again - I had not considered trying to do
> this the easy way(your way).

Instead of disabling these controls, or placing them on a disabled frame or
panel, just set their ReadOnly property.

Other Threads