1. 透明背景+修改文本颜色 //实用
<span style="font-size:18px;">HBRUSH CXXXDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
int id = pWnd-> GetDlgCtrlID();
if(id == IDC_STATIC_TEST)
{
<strong>pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(255,255,255));</strong>
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
else
{
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
return hbr;
}</span>