重复的控制盒

发布于 2024-10-11 11:28:56 字数 406 浏览 9 评论 0原文

我继承了一个作为 MDI 程序启动的应用程序,但必要的后台工作从未到位以完全支持 MDI。我正在尝试构建足够的 MDI 支持,以使应用程序看起来不错并且作为 SDI 应用程序正常工作。

这是我所观察到的,我不知道这是如何发生的或如何解决它。

  1. MDI 子窗体的边框显示在 MDI 父窗体的菜单条上方。
  2. MDIchild 窗体的左上角有两个图标。
  3. MDIchild 窗体的右上角有两个 ControlBox。

alt text

有什么想法吗?

如果 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.

  1. The MDIchild form's border is shown above the MDIparent form's menu strip.
  2. The MDIchild form has two icons in the upper left.
  3. The MDIchild form has two ControlBoxes in the upper right.

alt text

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失去的东西太少 2024-10-18 11:28:56

我创建了子窗体,但以正常状态显示它而不是最大化。就好像在与最大化子窗体相同的进程中显示父窗体导致窗体构造混乱。我的代码看起来像这样...

frmChild.WindowState = FormWindowState.Normal
frmParent.Show()  'frmChild.Show called within form_load of parent
frmChild.WindowState = FormWindowState.Maximized

是的,我将子窗口的 F​​ormBorderStyle 设置为 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...

frmChild.WindowState = FormWindowState.Normal
frmParent.Show()  'frmChild.Show called within form_load of parent
frmChild.WindowState = FormWindowState.Maximized

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.

路弥 2024-10-18 11:28:56

我发现:

在子窗体上设置 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文