rt

解决方案 »

  1.   

    响应窗口的WM_SIZE,在该消息中队控件进行重新布置
      

  2.   

    同意楼上的,用MoveWindow改变控件大小。
      

  3.   

    WM_SIZE 消息 ON_SIZE 里面处理
      

  4.   

    (父)窗口的WM_SIZE中,在该消息中对控件进行重新布置,父窗口要管理他的子窗口。
      

  5.   

    WM_SIZE 消息 ON_SIZE 里面处理
    要用到的函数有
    GetWindowRect();
    GetClientRect()
    ScreenToClient();
    ClinetToScreen()
    MoveWindow();
    搞定以上5个函数的用法,就OK了
      

  6.   

    还没搞定啊兄弟,把我的代码贴出来让你看看得了.
    void CChatServerDlg::OnSize(UINT nType, int cx, int cy) 
    {
    CDialog::OnSize(nType, cx, cy);
    ResizeCtrl();
    }//Resize the child control.
    void CChatServerDlg::ResizeCtrl()
    {
    CRect rect;
    GetClientRect(&rect); rect.DeflateRect(5,5,100,5);
    m_lstMsg.MoveWindow(rect); GetDlgItem(IDC_BTN_START)->MoveWindow(rect.right+10,rect.top,80,25);
    GetDlgItem(IDC_BTN_STOP)->MoveWindow(rect.right+10,rect.top+35,80,25);
    GetDlgItem(IDC_BTN_CLEAR)->MoveWindow(rect.right+10,rect.top+70,80,25);
    GetDlgItem(IDC_BTN_SET)->MoveWindow(rect.right+10,rect.top+105,80,25);

    GetDlgItem(IDCANCEL)->MoveWindow(rect.right+10,rect.bottom-25,80,25);
    }