MFC设置特定控件字体大小和背景颜色
初始化函数里
m_editFont.CreatePointFont(580 , _T("宋体"));
m_ctrlEdit.SetFont(&m_editFont);
重写消息
HBRUSH CMFCTESTDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == IDC_EDIT1)
{
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(RGB(255,0,0));
}
return hbr;
}