Link to home
Start Free TrialLog in
Avatar of visualc
visualc

asked on

CStatic background in CMyView

Hi!
I have create a CStatic control in my view, but I can't change the background color of the control becouse I can't process the WM_CTLCOLOR message from my view class.
How can I change the background color?
Thank you,
Tibi.

Avatar of tma050898
tma050898
Flag of United States of America image

What do you mean when you say that you "can't change the background color of the control" using WM_CTLCOLOR? Are you say that is the problem or that for some reason you don't want to change the static's background color via this mechanism???
ASKER CERTIFIED SOLUTION
Avatar of mikeblas
mikeblas

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 RONSLOW
RONSLOW

Please show you code (not just one line, either) where you create the static control.

Also show how you set up your WM_CTLCOLOR handler.

What you might like to try is deriving a class from CStatic that handles the WM_CTLCOLOR itself (use message reflection).  Then create a control of this type instead.  It is (generally) good OO design to let the cotrol class itself handle these sort of  messages.