WPF:检测窗口何时失去焦点 [英] WPF: Detect when Window loses focus
本文介绍了WPF:检测窗口何时失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检测窗口何时失去焦点?
How do I detect when my window loses focus?
推荐答案
Use the Window.Deactivated
event.
您可能正在寻找 应用程序.Deactivated
事件,只有当用户切换到不同的应用程序时才会触发.
You may be looking for the Application.Deactivated
event, which fires only if the user switched to a different application.
这篇关于WPF:检测窗口何时失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文