我扩展了一个CStatic标签类,在OnPaint()中写
CString str;
GetWindowText(str); dc.SetBkMode(TRANSPARENT);
dc.TextOut(0,0,str);
让背景透明,但是SetWindowText()时背景又恢复过来了,我试过很多方法,但都未成功,当我SetWindowText()时好像没有调用OnPaint(),请问怎么让背景重画?
CString str;
GetWindowText(str); dc.SetBkMode(TRANSPARENT);
dc.TextOut(0,0,str);
让背景透明,但是SetWindowText()时背景又恢复过来了,我试过很多方法,但都未成功,当我SetWindowText()时好像没有调用OnPaint(),请问怎么让背景重画?
{
HBRUSH hbr = CODDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (CTLCOLOR_STATIC == nCtlColor)
{
pDC->SetBkMode(TRANSPARENT);
return NULL_BRUSH;
}
return hbr;
}