我的 WindowsFormsApplication 落后于所有应用程序

发布于 2024-10-20 14:44:10 字数 172 浏览 3 评论 0原文

我开发了一个 WindowsFormsApplication,其边框样式窗体为“FixedToolWindow”,现在的问题是,当我要最小化任何其他打开的应用程序时,我的应用程序会落后于所有已打开的应用程序。我不明白问题到底出在哪里。那么有人可以帮我找出问题所在以及如何将其短路吗?

任何帮助将不胜感激。 提前致谢

I developed a WindowsFormsApplication having a Form of Border Style as "FixedToolWindow", now the problem is while I am going to minimize any other opened application then my application going behind of all the application opened already. I am not getting where the problem is exactly. So can anybody help me to find out where the problem and how to short out it ?

Any help will be appreciated.
Thanks in Advance

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

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

发布评论

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

评论(2

晨曦÷微暖 2024-10-27 14:44:10

该问题称为Z 顺序,它是由Windows 维护的屏幕上出现的窗口的内部从上到下的顺序。

当您单击该其他应用程序将其最小化时,它会成为“活动”应用程序,并且其窗口将移动到前台。这会将您的应用程序(曾经是前台窗口)推入后台,位于其他应用程序后面。这会导致其窗口被隐藏或遮挡在其他应用程序的窗口后面。单击应用程序的窗口将再次将其带到前台,使其覆盖其后面的所有窗口。

但要回答您真正的问题,不,您不应该为应用程序的窗口的BorderStyle指定“FixedToolWindow”。具有该边框样式的窗口不会出现在任务栏中,并且不会被视为应用程序的主窗口。该样式适用于除了应用程序主窗口之外还显示的工具窗口,例如浮动调色板。

The problem is called Z order, which is the internal top-to-bottom ordering of the windows that appear on the screen maintained by Windows.

When you click on that other application to minimize it, it becomes the "active" application and its window is moved to the foreground. That pushes your application (which used to be the foreground window) into the background, behind the other application. That causes its window to be hidden or obscured behind the window of the other application. Clicking on your application's window will bring it to the foreground again, causing it to cover up any windows that lie behind it.

But in answer to your real question, no, you should not have specified "FixedToolWindow" for the BorderStyle of your application's main window. Windows with that border style do not appear in the taskbar and are not treated as the main window of an application. That style is intended for tool windows, such as floating palettes, displayed in addition to an application's main window.

凉风有信 2024-10-27 14:44:10

如果您的表单旨在成为工具窗口,那么您可能希望它在显示时出现在所有其他表单之上。

因此,将其 TopMost 属性设置为 True。

否则,我同意 Cody Gray,主窗体不应具有 FixedToolWindow 边框样式。

If your form is intended to be a tool window then perhaps you would like it to appear above all other forms when shown.

Therefore, set it's TopMost property to True.

Otherwise, I agree with Cody Gray, no main form should have a FixedToolWindow border style.

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