使用 SW_MAXIMIZE 时在对话框中锚定按钮
这应该是一个简单的:
我有一个带有 2 个按钮的 CDialog。 使用 m_pMainWnd->ShowWindow(SW_MAXIMIZE);
始终以全屏方式打开对话框(无标题栏 \ 状态等...)
我希望我的按钮能够捕捉到屏幕边缘。
没有调整大小或任何东西。
This should be a simple one:
I have a CDialog with 2 buttons.
The dialog is always opened in full screen (No title bar \ Status, etc...) using m_pMainWnd->ShowWindow(SW_MAXIMIZE);
I want my buttons to snap to the edge of the screen.
There are no resizing or anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您知道对话框的宽度(GetClientRect)。您知道按钮的宽度。
假设您要捕捉到右边缘...
在您的 CDialog::OnSize 内:
You know the width of the dialog (GetClientRect). You know the width of the buttons.
Assuming you are snapping to the right edge ...
Inside your CDialog::OnSize: