各位大哥大姐:
如何进行工具栏背景颜色的设置?
我的工程是基于多文档的,应该在哪个类的那个函数中进行设置?
谢谢! 急!
处理窗体的WM_COLOR消息:
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
switch(nCtlColor)
{
case CTLCOLOR_BTN :
{
if(pWnd->GetDlgCtrlID() == IDC_YOUR_BUTTON)
{
static HBRUSH hbrEdit = ::CreateSolidBrush( RGB(255, 255, 255) );
pDC->SetBkColor( RGB(250, 250, 250) );
pDC->SetTextColor( RGB(0, 0, 0) );
return hbrEdit;
}
}
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
return hbr;
}