3 回答

慕仙森
TA貢獻1827條經驗 獲得超8個贊
在主窗口里響應WM_CTLCOLOR消息.如果不行再HI我
HBRUSH CEdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(IDC_EDIT1 == pWnd->GetDlgCtrlID() && nCtlColor == CTLCOLOR_EDIT)
{
COLORREF clr = RGB(0,0,0);
pDC->SetBkColor(clr);
return ::CreateSolidBrush(clr);
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
- 3 回答
- 0 關注
- 1016 瀏覽
添加回答
舉報
0/150
提交
取消