16,472
社区成员
发帖
与我相关
我的任务
分享
HBRUSH CVirtualEarthquakePlayDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor==CTLCOLOR_STATIC)
{
pDC-> SetTextColor(RGB(0,0,0)); //字体颜色
pDC-> SetBkMode(TRANSPARENT); //设置字体背景为透明
return (HBRUSH)::GetStockObject(NULL_BRUSH);
} return hbr;
}
if (m_leid == 1)
{
if((BST_CHECKED==((CButton*)GetDlgItem(IDC_CHECK1))->GetCheck())
&&m_ckey)
{
m_ckey = 0;
m_ld3.SetTextColor(RGB(255,0,0));
}
else
{
m_ckey = 1;
m_ld3.SetTextColor(RGB(0,0,0));
}
}
CLabel& CLabel::SetTextColor(COLORREF crText)
{
m_crText = crText;
RedrawWindow();
return *this;
}