class CFfDlg : public CDialog
{
// Construction
public:
CFfDlg(CWnd* pParent = NULL);
BOOL forl;
int biliw;
int bilih;// standard constructor
CRect rect1,rect2;
。
};BOOL CFfDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...........................
GetClientRect(&rect2);
GetDlgItem(IDC_EDIT1)->GetWindowRect(&rect1);
biliw=rect2.right-rect1.right;
bilih=rect2.bottom-rect1.bottom;
forl=TRUE;
return TRUE;
}void CFfDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if(forl==TRUE){
CWnd * pWnd = GetDlgItem(IDC_EDIT1);
if( pWnd )
{
CRect rctmp;
GetWindowRect(&rctmp);
CRect rectm(rect1.left,rect1.top,rctmp.right-biliw,rctmp.bottom-bilih);
pWnd->MoveWindow(&rectm);
} }
}
{
// Construction
public:
CFfDlg(CWnd* pParent = NULL);
BOOL forl;
int biliw;
int bilih;// standard constructor
CRect rect1,rect2;
。
};BOOL CFfDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...........................
GetClientRect(&rect2);
GetDlgItem(IDC_EDIT1)->GetWindowRect(&rect1);
biliw=rect2.right-rect1.right;
bilih=rect2.bottom-rect1.bottom;
forl=TRUE;
return TRUE;
}void CFfDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if(forl==TRUE){
CWnd * pWnd = GetDlgItem(IDC_EDIT1);
if( pWnd )
{
CRect rctmp;
GetWindowRect(&rctmp);
CRect rectm(rect1.left,rect1.top,rctmp.right-biliw,rctmp.bottom-bilih);
pWnd->MoveWindow(&rectm);
} }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货