I create a vc6 project with a CFormView using bcgbcpro 6.70, when i add a group box to the form view,it doesn't display correctly! if i set TRANSPARENT style to it,its ok. But I need redrawwindow, and the Group box is disappeared after redrawwindow, is it a Bug? I need strong support about this issue,my schedule is urgent! Thanks very much!!!!! The source code as below: void CRTPrintSetForm::OnRadio1() { RedrawWindow(); DrawPortrait(); }
void CRTPrintSetForm::OnRadio2() { RedrawWindow(); DrawLandScape(); }
void CRTPrintSetForm::DrawPortrait() { CWnd *pWnd = GetDlgItem(IDC_STATIC_PICTURE CDC* pDC = pWnd->GetDC(); CRect rect; pWnd->GetClientRect(&rect); pDC->MoveTo(rect.Width()/6,0); pDC->LineTo(5*rect.Width()/6,0); pDC->LineTo(5*rect.Width()/6,rect.Width()); pDC->LineTo(rect.Width()/6,rect.Width()); pDC->LineTo(rect.Width()/6,0); pWnd->ReleaseDC(pDC);
}
void CRTPrintSetForm::DrawLandScape() { CWnd *pWnd = GetDlgItem(IDC_STATIC_PICTURE); CDC* pDC = pWnd->GetDC(); CRect rect; pWnd->GetClientRect(&rect); pDC->MoveTo(0,rect.Width()/6); pDC->LineTo(rect.Width(),rect.Width()/6); pDC->LineTo(rect.Width(),5*rect.Width()/6); pDC->LineTo(0,5*rect.Width()/6); pDC->LineTo(0,rect.Width()/6); pWnd->ReleaseDC(pDC);//ÊÍ·ÅDC
} |