WPF C#防止窗口失去焦点 [英] WPF C# prevent window from losing focus

查看:808
本文介绍了WPF C#防止窗口失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
过去,当我使用Windows窗体时,有一个非常有用的窗口属性,它称为PreventWindowFocusChange或其他名称.当启用并使用多窗口程序时,这将使您无法使用背面的其他窗口,而只能使用您应该使用的窗口.如何在WPF中进行管理?

Hello,
when I was using windows forms back in the days there was a very helpful property for a window, it was called PreventWindowFocusChange or something. when enabled and working with a multiple window program, this prevents you from being able to use the other windows in the back and only lets you use the one your supposed to work with. How do I manage this in WPF?
thanks in advance.

推荐答案

^ ]可能会有所帮助.
This[^] could help.


您的要求并不意味着关注焦点改变";您想使窗口保持激活状态.激活状态和焦点是相关的,但是它们是完全不同的概念.焦点是仅与键盘输入相关的东西,并且是焦点控件的属性.

如果有人实施了该功能,那将是一场灾难.作者应得到公开处决.谁会容忍这样的程序?我仍然希望您需要其他功能,也许这是Kiosk模式.

请参阅:
使用C#以Kiosk模式运行网站 [ c#程序ctrl-alt-del屏幕窗口7 [ ^ ].

—SA
What you ask does not mean "focus change"; you want to keep window activated. Activated status and focus are related but they are very different concept. Focus is something related only the keyboard input only and is the attribute of focused controls.

If somebody implemented that feature it would be a disaster; and the author would deserve public execution. Who would ever tolerate a program which behaves like that? I still hope you need something different and maybe this is the Kiosk Mode.

Please see:
Running a Web Site in Kiosk Mode with C#[^],
c# program ctrl-alt-del screen windows 7[^].

—SA


这篇关于WPF C#防止窗口失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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