求教一下为什么MoveWindow在OnInitDialog()使用无效
我在OnInitDialog()中用MoveWindow想改变一个控件的位置和大小,但控件的大小和位置没有变动,MoveWindow后我获取了一下控件的CRect, 控件的值是变动成为了我要的,但为什么显示的还是原来的呀???
代码如下:
BOOL CVCPhoneDlg::OnInitDialog()
{
CDialog::OnInitDialog();
.....
// TODO: Add extra initialization here
.....
// 呼叫按钮设置
pWnd = GetDlgItem(IDC_BUTTON_CALL);
nBottonT = nTop + nH + 2*nSpaceBetween;
pWnd->MoveWindow(nBottonL, nBottonT, nButtonW, nButtonH);
CRect rect;
pWnd->GetWindowRect(&rect);
CString strTemp;
strTemp.Format(_T("nButtonW = %d \n nButtonH = %d \n left = %d \n top = %d"),
rect.Width(), rect.Height(), rect.left, rect.top);
AfxMessageBox(strTemp);
return TRUE; // return TRUE unless you set the focus to a control
}