1:使用WM_CTLCOLOR消息
HBRUSH CDlgServerLogin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if (nCtlColor = IDC_STATIC) {
pDC->SetBkMode(TRANSPARENT);
pDC->SetBkColor(RGB(255,255,255));
return (HBRUSH)::GetStockObject(NULL_BRUSH);
}
}
2.在OnPaint()里面TextOut文本