WPF - Is there a way to cause a UI element to lose focus without changing the focus to something else?

落花浮王杯 提交于 2019-12-11 12:37:29

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/2664460/wpf-is-there-a-way-to-cause-a-ui-element-to-lose-focus-without-changing-the-fo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!