fadyg
asked on
changing color font in disabled edit box
Hi,
is there a way of changing the color of the font in a disabled tedit control? i.e is it possible to have the contents displayed in something different than the grey color to show a disabled status ? (for ex: I want red font over white background when control is disabled)
is there a way of changing the color of the font in a disabled tedit control? i.e is it possible to have the contents displayed in something different than the grey color to show a disabled status ? (for ex: I want red font over white background when control is disabled)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ok to try this put my comp on a form and a button
give my comp some disabledcolors then on button click type this:
SetWindowLong(DisabledColo rEdit1.Han dle,GWL_ST YLE,
GetWindowLong(DisabledColo rEdit1.Han dle,GWL_ST YLE) or WS_DISABLED);
DisabledColorEdit1.Enabled :=False;
this will stop it from recieving focus
if you want it to recieve focus type this:
SetWindowLong(DisabledColo rEdit1.Han dle,GWL_ST YLE,
GetWindowLong(DisabledColo rEdit1.Han dle,GWL_ST YLE) and not WS_DISABLED);
Regards Barry
give my comp some disabledcolors then on button click type this:
SetWindowLong(DisabledColo
GetWindowLong(DisabledColo
DisabledColorEdit1.Enabled
this will stop it from recieving focus
if you want it to recieve focus type this:
SetWindowLong(DisabledColo
GetWindowLong(DisabledColo
Regards Barry
ASKER
your component would work correctly but this would give me a control that can get the focus (even though you won't be able to change anything because it's a read-only). What is needed is the exact same behaviour as diabled i.e. no focus.
any ideas ?