各位大侠,
VC中如何实现对话框中控件大小随对话框的大小自动调整!!能给个例吗??

解决方案 »

  1.   

    在OnSize函数里用MoveWindow函数。
      

  2.   

    void CCommDlgDlg::OnSize(UINT nType, int cx, int cy) 
    {
    CDialog::OnSize(nType, cx, cy);

    static BOOL init=FALSE;
    // TODO: Add your message handler code here
    if(!init)
    {
    init=TRUE;
    return;
    }
    CRect rect;
    GetClientRect(&rect); CRect btnRect;
    GetDlgItem(IDC_BUTTON5)->GetWindowRect(&btnRect);
    ScreenToClient(&btnRect);
    GetDlgItem(IDC_BUTTON5)->MoveWindow(rect.right-btnRect.Width()-10,btnRect.top,btnRect.Width(),btnRect.Height());
    }
      

  3.   

    使用EasySize.h类吧,很方便的说,网上到处都是
      

  4.   

    [email protected]  
    给我也来一份-
      

  5.   

    http://www.codeproject.com/dialog/resizablelib.asp
      

  6.   

    我的email是:[email protected]
    谢谢了!!