上面的不对 这样才好 HBRUSH CDdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_EDIT) { if(pWnd->GetDlgCtrlID() == IDC_EDIT1) { pDC->SetTextColor(RGB(255,0,0));//改变字体颜色 } } return hbr; }