怎么更改按钮的背景和字体颜色

如何更改按钮的背景和字体颜色
我自定义了一个CButton类MyButton,请问在MyButton类的哪个函数中用哪些语句能改更背景和字体颜色?

------解决方案--------------------
CWnd::OnCtlColor
afx_msg HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );

Return Value

OnCtlColor must return a handle to the brush that is to be used for painting the control background.

Parameters

pDC

Contains a pointer to the display context for the child window. May be temporary.

pWnd

Contains a pointer to the control asking for the color. May be temporary.

nCtlColor

Contains one of the following values, specifying the type of control:

CTLCOLOR_BTN Button control


CTLCOLOR_DLG Dialog
------解决方案--------------------
button的属性重绘即在button组件上,右键弹出的property的属性中,把owner draw勾选上即可,OnCtlColor中,最后一句为返回的画刷句柄(注意把VC自动生成的return brush屏蔽掉)
然后,改为return (HBRUSH)GetStockObject(BLACK_BRUSH);这是用黑色的画刷重绘按钮表面,DRAWItem里面有个CREATESTRUCT的结构,你可以看一下MSDN;