WPF Editable Combobox IsFocused问题 [英] WPF Editable Combobox IsFocused problem

查看:242
本文介绍了WPF Editable Combobox IsFocused问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过修改 ComboBox ControlTemplate 开发水印 ComboBox $ c>。一切都很好当 ComboBox 不是在可编辑模式,但当我将编辑模式更改为True时, IsFocused 属性永远不会设置为True。这是因为在编辑模式下, ComboBox 正在使用 TextBox 。这是此 StackOverflow的精确副本问题:。没有对这个问题的答复。

I am developing a Watermarked ComboBox by modifying the ComboBox ControlTemplate. Everything is fine when the ComboBox is not in an editable mode, but when I change the edit mode to True, the IsFocused property is never set to True. This is because in edit mode, the ComboBox is using a TextBox. This is an exact copy of this StackOverflow question: . There are no responses to that question.

如果您知道如何解决这个问题,请放置一行,或者请指向提供水印 ComboBox 实现。
谢谢,
Rey。

Please drop a line if you know how to solve this, or please point me to links that provide a Watermark ComboBox implementation. Thanks, Rey.

推荐答案

您可以尝试使用 IsKeyboardFocused IsKeyboardFocusWithin

You could try to use the IsKeyboardFocused or IsKeyboardFocusWithin instead

这篇关于WPF Editable Combobox IsFocused问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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