只是重写了OnEraseBkgnd(CDC* pDC) 设置背景图片 有这个函数
HBRUSH COperLogin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
switch( nCtlColor)
{
case CTLCOLOR_EDIT:
return (HBRUSH)GetStockObject(WHITE_BRUSH);
case CTLCOLOR_DLG:
case CTLCOLOR_BTN:
case CTLCOLOR_STATIC:
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
default:
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
}
/*
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
return hbr;
*/
}