MFC:“粘合”两个窗口/对话框在一起
我正在尝试进行一些设置,以便我的主对话框具有一个或多个子对话框,并且这些子对话框被粘合/停靠在主对话框的外部 - 当主对话框最小化时,子对话框将同样,当主对话框移动时,孩子们也会随之移动。
我尝试将子对话框设置为以主对话框 CWnd 作为父对话框,并采用 CHILD 样式。但随后他们就会被父母的边界所限制。如果我将它们设置为 POPUP,它们可以在外面,但不会与父级一起移动。
我正在考虑在父对话框上放置一个 OnMove 处理程序,但是有内置的东西吗?而且,子对话框是否仍然是主对话框的子对话框......我认为它们应该?
这是VS2005(我认为VS2008有一些相关的功能所以我提到这一点)。
I'm trying to set something up so my main dialog has one or more child dialogs, and these are glued/docked to the outside of the main dialog - when the main dialog is minimised, the children are too, when main dialog moves, children move with it.
I'd tried setting child dialogs as having main dialog CWnd as parent, with CHILD style. But then they get clipped by the parent's boundary. If I set them as POPUP, they can be outside but then don't move with the parent.
I'm looking at putting an OnMove handler on the parent dialog, but is there something built-in? And, should child dialogs still be children of the main dialog... I assume they should?
This is VS2005 (I think VS2008 has some related functionality so I mention this).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当它们是弹出窗口时,您需要手动实现移动,是的,它们应该是弹出窗口,否则它们将被剪掉。
You need to implement the movement manually when they are popups, and yes they should be popups otherwise they will be clipped out.
我是新来的。不确定是否可以参考外部文章。
我想 这 就是您正在寻找的。
I'm new to SO. Not sure if I can refer to an external article.
I guess this is what you are looking for.
正如 Roel 所说,额外的对话框需要是弹出窗口。我感兴趣的是:这是什么样的用户界面?是 WinAmp 风格吗?窗口彼此对齐?
或者你正在做某种扩展对话?如果它是一个扩展对话框(例如,上面有一个
More>>
按钮),那么您可以将所有控件放在同一个对话框上,并在显示/隐藏附加内容时使用窗口矩形。As Roel says, your extra dialogs will need to be popups. I'm interested: what kind of UI is this? Is it WinAmp-style, where the windows snap to eachother?
Or are you doing some kind of expanding dialog? If it's an expanding dialog (with a
More>>
button on it, e.g.), then you can put all of the controls on the same dialog and play with the window rect when showing/hiding the extras.