WPF的窗口最上面只有自己的应用程序? [英] WPF-Window Topmost for own application only?

查看:316
本文介绍了WPF的窗口最上面只有自己的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

闪屏/载入-窗口在我的WPF应用程序设置为最顶层=真。现在这个窗户上的所有其他窗口的顶部,甚至当你切换到另一个应用程序(因为加载需要一段时间)。我不希望这种行为。

The Splashscreen/Loading-Window in my WPF application is set to Topmost="True". Now this windows in on top of all other windows even when you switch to another application (because loading will take some time). I don't want this kind of behavior.

如果我将最顶层=FALSE的未中最顶层的所有窗口。但如果你有工作与其他应用程序后切换回我的应用我的客户有时并没有意识到,加载Windows的仍然是工作。该应用程序看上去不响应,因为装载 - 窗口在后台仍然是活动窗口,这是模式的。

If I set Topmost="False" the window in not topmost at all. But If you switch back to my application after working with with another application my customers sometimes don't realize the Loading-Windows is still working. The application appears to be unresponsive because the Loading-Window in the background is still the active window and it is modal.

我希望有装载 - 窗口最上面的,但只有如果我的应用程序是在前台。如果您切换到另一个程序的窗口应该消失,当你切换回再次出现最上面。

I want to have the Loading-Window topmost but only if my application is in foreground. If you switch to another program the window should disappear and reappear topmost when you switch back.

推荐答案

您可以尝试使用所有者窗口的属性,与启动画面总是会重叠其他窗口。

You can try to use the "Owner" property of the window, with that the splash screen will always overlap the other windows.

这篇关于WPF的窗口最上面只有自己的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆