Link to home
Start Free TrialLog in
Avatar of mdkhanga
mdkhanga

asked on

Changing Font/appearance of MFC controls

How do I change the font, background color etc for standard controls like static text, button. ?

I know that I should derive a class from say CStatic ( for static text ) or CButton ( for button).

Which handler functions should I override to change the properties of the device context and to customize the painting of the control ?
Avatar of cyrilbdt
cyrilbdt

for background ovveride WM_ERASEBKGND.
for font try CWnd::SetFont()
Avatar of mdkhanga

ASKER


I need a more complete answer that discusses the commonly encountered issues of customizing a control by inheriting from a control class and overriding the message handler functions.

For my customized control, I should be able to say change the font, the background color, text foreground and text background color.

It is possible that more that one message handler may have to be overriden.

I will give points to the expert who explains the concepts.

No points for answers that say try this or try that.

ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

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