// TODO: Change any attributes of the DC here if(CTLCOLOR_EDIT==nCtlColor) { pDC-> SetTextColor(RGB(0, 0, 0)); pDC-> SetBkColor(RGB(255,0,0)); hbr = ::CreateSolidBrush(RGB(255,0,0)); } // TODO: Return a different brush if the default is not desired return hbr; }
HBRUSH CWEComboBox::OnCtlColor(CDC* pDC,CWnd* pWnd,UINT nCtlColor)
{
HBRUSH hbr = ::CreateSolidBrush(RGB(255,0,0));
return hbr;
}
出现的情况很奇怪求解
HBRUSH CQwDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(CTLCOLOR_EDIT==nCtlColor)
{
pDC-> SetTextColor(RGB(0, 0, 0));
pDC-> SetBkColor(RGB(255,0,0));
hbr = ::CreateSolidBrush(RGB(255,0,0));
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
http://blog.csdn.net/xianglitian/article/details/1731056
http://blog.csdn.net/xianglitian/article/details/6359058