将 MDI 表单置于最前面时遇到问题

发布于 2024-11-25 06:25:18 字数 236 浏览 0 评论 0原文

想象一下,我的父窗体中有两个 MDI 窗体。

每个表单内部都有很多控件,有些甚至是自定义 Infragistics 控件,例如 UltraPanel。

目前,当两个表单都打开并处于正常大小模式(不是最大化或最小化)时,我只能通过单击表单标题栏将一个表单置于另一个表单的前面。

如果我在表单本身内部单击,它不会被带到前面。有什么方法可以让我捕获 MDI 表单中任何地方的点击并将其置于最前面吗?

Imagine I have two MDI forms inside of a parent form.

Each form has many many controls inside, some are even custom Infragistics controls such as an UltraPanel.

Currently when both forms are open and in normal sized mode (not maximize or minimized), I can only bring one form to the front of the other by clicking on the forms title bar.

If I click inside the form itself, it's not brought to the front. Is there some way for me to capture the click anywhere inside the MDI form and bring that one to the front?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

蓝颜夕 2024-12-02 06:25:18

将 DoubleClick 事件添加到子表单并设置:

this.WindowState = FormWindowState.Maximized;

Add a DoubleClick event to the child form and set:

this.WindowState = FormWindowState.Maximized;
淡淡绿茶香 2024-12-02 06:25:18

就我们而言,我们有一个功能齐全的应用程序,几年来它运行良好,mdiConroler 没有问题。
我刚刚添加了删除/设置 mdiParent 到表单的功能。它有效,可以删除表单并将其添加到 mdiParent 中。
但是,我们有完全相同的错误。一旦我们将表单放入 mdi 父级中,该错误就会出现。

这两种情况都会导致错误:

  • 如果我们有一个位于 mdiClient 中的表单,我们将其删除,然后将其添加回来,则会发生错误。
  • 对于在 mdiClient 外部创建然后添加的表单,也会发生这种情况。

当错误发生时,解决方法是关闭所有 mdiChild,然后正常行为再次开始工作。

On our end, we have a fully functional app, it's working great since a couple of years, no problem with mdiConroler.
I just added the functionality to remove/set mdiParent to a form. It works, the forms can be remove and add as much as we want into the mdiParent.
BUT, we have that exact same bug. As soon as we had a form into the mdi parent, the bug is present.

Both of these scenario are causing the bug :

  • If we had a form, located in the mdiClient, we remove it, and add it back, the bug happens.
  • It also happens for a form that is created outside of the mdiClient, then added.

A workaround, when the bug happens, is to close all mdiChild, then the normal behavior start working again.

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