CRect recttemp;
GetDlgItem(IDC_BUTTON3)->GetWindowRect(&recttemp);
GetDlgItem(IDC_BUTTON1)->MoveWindow(recttemp.left,recttemp.top,recttemp.Width(),recttemp.Height());我想把对话框上Button1移到Button3上,Button3设置了不可见,这样代码有什么问题不?怎么实现不了啊。
对话框是通过点击单文档上的菜单弹出来的模态对话框

解决方案 »

  1.   

    没试过不过应该可以先把Button3.ShowWindow(SW_HIDE)了?你是移动不了?
    还是点击按钮没反应?1.MoveWindow()
    2.SetWindowPos()如果有必要 把CWnd*强制转换一下为CButton* 
      

  2.   

    BOOL ClientToScreen(
      HWND hWnd,       // handle to window
      LPPOINT lpPoint  // screen coordinates
    );用这个函数把recttemp转换成屏幕坐标的recttemp试试
      

  3.   

    void ClientToScreen( LPRECT lpRect ) const;这个贴错。。
      

  4.   

    Button1.ShowWindow(SW_HIDE)
    Button3.ShowWindow(SW_SHOW)
      

  5.   


    确实是需要利用ClientToScreen()转化
    谢谢啦@!