在对话框中有一个 单选按钮 现在我把对话框的背景色 改成了 蓝色 但是 单选按钮 那 还是灰突突的一块  怎么能让单选按钮 和 对话框颜色一样

解决方案 »

  1.   

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

    // TODO: Change any attributes of the DC here
    if(IDC_RADIO1 == pWnd->GetDlgCtrlID())
    {
    pDC->SetBkMode(TRANSPARENT);
    return (HBRUSH)GetStockObject(NULL_BRUSH);
    }
    // TODO: Return a different brush if the default is not desired
    return hbr;
    }
      

  2.   


    莫非是(HBRUSH)GetStockObject(...)