如何定义热键来编辑自动完成框中的文本?
我正在使用 WPF AutoCompleteBox 控件,我需要定义一个热键来立即开始编辑其内容。我有这样的:
if (Keyboard.IsKeyDown(Key.LeftAlt) && Keyboard.IsKeyDown(Key.F))
autoCompleteBox2.Focus();
该代码设置了焦点,但版本没有开始。我必须手动按左键或右键才能使用它。我在他的财产和网络上搜索过,但仍然没有找到答案。
该控件是 WPF 工具包的一部分。 http://wpf.codeplex.com/releases/view/40535
I'm using the WPF AutoCompleteBox control, i need to define a hotkey to begin the edition of its content immediatelly. I have this:
if (Keyboard.IsKeyDown(Key.LeftAlt) && Keyboard.IsKeyDown(Key.F))
autoCompleteBox2.Focus();
That code set the focus but the edition doesn't begin. I have to manually press the Left or Right key and then i could use it. I've search in his properties and in the web but I still don't found the answer.
That control is part of the WPF Toolkit. http://wpf.codeplex.com/releases/view/40535
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在正在编码的内容中遇到了这个问题,这就是我解决它的方法,这有点棘手:
将焦点移开:
对我有用,你需要设置:
如果它仍然不起作用您阅读过此内容,它应该会有所帮助。
I've had this issue in what I am coding right now, this is how I solved it, it is a little tricky:
To move the focus away:
worked for me, you need to have set:
if it still doesn't work have you read this, it should help.