我在编辑框的属性中选择了Transparent, 但是为什么不能透明?
请问如何是编辑框能和对话框的融背景为一体?
  敬请赐教!

解决方案 »

  1.   

    HBRUSH CAsdfsdfdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
    if(pWnd->GetDlgCtrlID()==IDC_EDIT1)
    {
    pDC->SetBkMode(TRANSPARENT);
    pDC->SetBkColor(GetSysColor(COLOR_BTNFACE));
    hbr=(HBRUSH)(COLOR_BTNFACE+1);
    }
    // TODO: Change any attributes of the DC here

    // TODO: Return a different brush if the default is not desired
    return hbr;
    }