MFC对话框贴图基础上控件Stasic变成透明的
对应WM_CTLCOLOR函数
加入下面代码:
HBRUSH CMFCApplication2Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { .....
switch (pWnd->GetDlgCtrlID()) { case IDC_STATIC: { pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(RGB(0, 0, 0)); return (HBRUSH)GetStockObject(HOLLOW_BRUSH); } default: break; }
return hbr; }好就此搞定!