CRect recttemp;
GetDlgItem(IDC_BUTTON3)->GetWindowRect(&recttemp);
GetDlgItem(IDC_BUTTON1)->MoveWindow(recttemp.left,recttemp.top,recttemp.Width(),recttemp.Height());我想把对话框上Button1移到Button3上,Button3设置了不可见,这样代码有什么问题不?怎么实现不了啊。
对话框是通过点击单文档上的菜单弹出来的模态对话框
GetDlgItem(IDC_BUTTON3)->GetWindowRect(&recttemp);
GetDlgItem(IDC_BUTTON1)->MoveWindow(recttemp.left,recttemp.top,recttemp.Width(),recttemp.Height());我想把对话框上Button1移到Button3上,Button3设置了不可见,这样代码有什么问题不?怎么实现不了啊。
对话框是通过点击单文档上的菜单弹出来的模态对话框
还是点击按钮没反应?1.MoveWindow()
2.SetWindowPos()如果有必要 把CWnd*强制转换一下为CButton*
HWND hWnd, // handle to window
LPPOINT lpPoint // screen coordinates
);用这个函数把recttemp转换成屏幕坐标的recttemp试试
Button3.ShowWindow(SW_SHOW)
确实是需要利用ClientToScreen()转化
谢谢啦@!