15,979
社区成员
发帖
与我相关
我的任务
分享
HBRUSH CDlg9Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(pWnd->GetDlgCtrlID() == IDC_STATIC1)
{
//选择红色画刷
static CBrush brRead;
if(brRead.m_hObject == NULL)
brRead.CreateSolidBrush(RGB(255, 0, 0));
hbr = (HBRUSH)brRead;
//背景透明
pDC->SetBkMode(TRANSPARENT);
//字体颜色
pDC->SetTextColor(RGB(255, 255, 0));
}
// TODO: Return a different brush if the default is not desired
return hbr;
}