我想改变对话框的大小,但是改变后总是从对话框的右上角开始计算新的对话框,能不能任意的位置开始.

解决方案 »

  1.   

    什么意思?你是用MoveWindow来调整的吧。用SetWindowPos,在调整大小的同时调整位置即可
      

  2.   

    用::MoveWindow而不是对话框类的MoveWindow Method
      

  3.   

    不好意思,没有描述清楚,一般改变:
    BOOL MoveWindow(
      HWND hWnd,      // handle to window
      int X,          // horizontal position
      int Y,          // vertical position
      int nWidth,     // width
      int nHeight,    // height
      BOOL bRepaint   // repaint flag
    );
    我像这样的功能BOOL MoveWindow(
      HWND hWnd,      // handle to window
      int X,          // horizontal position
      int Y,          // vertical position
     int nTop,       //新的对话框相对于老对话框的有上角坐标,(nTop,nLeft)起点在原对话
     int nLeft,      //框的(nTop,nLeft)的位置。
      int nWidth,     // width
      int nHeight,    // height
      BOOL bRepaint   // repaint flag
    );也不知道说清楚了没有;)
      

  4.   

    先用CRect调整对话框的大小,然后再用SetWindowPos来设置对话框的位置和大小.呵呵!有什么好的思路还请能告诉我啊!谢谢!