重复的控制盒
我继承了一个作为 MDI 程序启动的应用程序,但必要的后台工作从未到位以完全支持 MDI。我正在尝试构建足够的 MDI 支持,以使应用程序看起来不错并且作为 SDI 应用程序正常工作。
这是我所观察到的,我不知道这是如何发生的或如何解决它。
- MDI 子窗体的边框显示在 MDI 父窗体的菜单条上方。
- MDIchild 窗体的左上角有两个图标。
- MDIchild 窗体的右上角有两个 ControlBox。
有什么想法吗?
如果 MDIChild 窗口边框(包括图标和控制框)被完全删除,我会非常高兴。
谢谢, SH
I have inherited an application that was started as an MDI program, but the necessary background work was never put in place to fully support MDI. I'm trying to build in just enough MDI support to make the application look good and work properly as an SDI application.
Here's what I am observing, and I don't know how this is happening or how to fix it.
- The MDIchild form's border is shown above the MDIparent form's menu strip.
- The MDIchild form has two icons in the upper left.
- The MDIchild form has two ControlBoxes in the upper right.
Any ideas why this would be?
I'd be really happy if the MDIChild window border (including the icons and control boxes) was removed entirely.
Thanks,
SH
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我创建了子窗体,但以正常状态显示它而不是最大化。就好像在与最大化子窗体相同的进程中显示父窗体导致窗体构造混乱。我的代码看起来像这样...
是的,我将子窗口的 FormBorderStyle 设置为 None,但正如我所说,我不需要 MDI 应用程序。
我认为这一定是 Visual Studio 中的一个错误。让这么多人都遇到困难,这是不对的。
I created the child form but showed it in normal state instead of maximized. It's as if showing the parent form in the same process as the maximized child form caused the form to be constructed out of order. My code looked something like this...
And yes, I set the Child window's FormBorderStyle to None, but like I said, I didn't want an MDI application.
I think this must be a bug in Visual Studio. For so many people to have difficulty with it, it can't be right.
我发现:
在子窗体上设置 WindowState 属性之前,在 MDI 窗体上调用 Show() 以消除多个控制框。
不要在设计器中将 WindowState 设置为最大化 - 在显示父级后在代码中执行此操作。
I found:
Call Show() on your MDI form before setting the WindowState property on your child form to get rid of the multiple control boxes.
Do not set the WindowState to Maximized in the designer -- do it in code after you've shown the parent.