Answers
然后重载对话框的WM_CTLCOLOR消息响应函数:
在OnCtlColor中添加如下代码:
HBRUSH CYourDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
switch(pWnd->GetDlgCtrlID())
{
case IDC_STATIC1:
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(0,0,0));
return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
default: break;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
玫瑰花D葬礼。
answered 12 years, 1 month ago