HBRUSH CSerialSetPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here

// TODO: Return a different brush if the default is not desired
if(nCtlColor == CTLCOLOR_DLG ||  nCtlColor == CTLCOLOR_BTN || nCtlColor ==  CTLCOLOR_STATIC)

{   
pDC->SetBkMode(TRANSPARENT);     
}   
return   HBRUSH(GetStockObject(HOLLOW_BRUSH));
}

解决方案 »

  1.   

    return HBRUSH(GetStockObject(HOLLOW_BRUSH));
    因为你最后都返回了这个了
      

  2.   

    我猜你是这个意思吧
    HBRUSH CSerialSetPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)  
    {
    HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);// TODO: Change any attributes of the DC here// TODO: Return a different brush if the default is not desired
    if(nCtlColor == CTLCOLOR_DLG || nCtlColor == CTLCOLOR_BTN || nCtlColor == CTLCOLOR_STATIC){   
    pDC->SetBkMode(TRANSPARENT);   
     return HBRUSH(GetStockObject(HOLLOW_BRUSH));
    }   
    return hbr;
    }