WPF - 有没有办法让一个UI元素失去焦点,而不改变焦点到别的东西? [英] WPF - Is there a way to cause a UI element to lose focus without changing the focus to something else?

查看:145
本文介绍了WPF - 有没有办法让一个UI元素失去焦点,而不改变焦点到别的东西?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个IsFocused属性添加到我正在处理的自定义文本框中,是否有任何方法可以执行此操作?

解决方案

然而,一般情况下,总是有一些焦点。


I would like to add an IsFocused property to a custom textbox that I am working on, is there any way to do this?

解决方案

Unless I'm mistaken something always has to be in focus. That being said you can Focus to a label or some non-editable/non-selectable element if you need. Or you can focus another application.

In general, however, something is always in focus.

这篇关于WPF - 有没有办法让一个UI元素失去焦点,而不改变焦点到别的东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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