Link to home
Start Free TrialLog in
Avatar of vardis
vardis

asked on

How to Change color of a CEdit

I would like to change the color of a CEdit control. Can it be done?
Please help..
Avatar of vardis
vardis

ASKER

Adjusted points to 20
Catch the OnCtlColor message of the CWnd
// Code
if(nCtlColor == CTLCOLOR_EDIT)
{
  pDC->SetBkColor(RGB(255,255,255));
  return CreateSolidBrush(RGB(255,255,255));
}
Avatar of vardis

ASKER

Thank you jubjub for the answer
The code works fine but there is a problem when it is executed it changes the color of ALL CEdit controls
Is there a way of changing color of just one?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of payn
payn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vardis

ASKER

Thank you payne for a very informative and detailed explanation I'll try your suggestion/solution. It has answered my question.

Regards Vardis.