AutoCompleteComboBox箭头向上/向下箭头键来滚动列表 [英] AutoCompleteComboBox Arrow Up/Arrow Down keys to scroll list

查看:599
本文介绍了AutoCompleteComboBox箭头向上/向下箭头键来滚动列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的 AutoCompleteBox 在我的 WPF 应用程序,它加载伟大的代码拦截填充事件,但当列表弹出并我打向下箭头键,并获得列表中的垂直滚动条不滚动的结束。

I created a simple AutoCompleteBox in my WPF app and it loads great with code intercepting the Populate event, but when the list pops up and I hit the arrow down key and get to the end of the list the vertical scroll bar doesn't scroll.

的值保持在该领域改变像它是通过他们的滚动,但滚动条不运动。

The values keep changing in the field like it is scrolling through them, but the scroll bar doesn't move.

如果我用鼠标它滚动的罚款。

If I use the mouse it scrolls fine.

我只需要方向键滚动它。

I just need the arrow key to scroll it.

任何意见/建议吗?

我是新来的 WPF 并搜查永远为这个修补程序。

I am new to WPF and have searched forever for this fix.

推荐答案

我看到相同的行为。我发现CodePlex的帖子谈论不同的问题,但他们有一个帖子的底部类AutoCompleteBoxEx支持ScrollIntoView,所以你甚至可以勾起来的SelectionChanged,这应该得到你想要的行为。我不知道这是为什么不烤。我有机会来测试张贴的代码。

I see the same behavior. I found a post on codeplex talking about a different issue but at the bottom of the post they have a class AutoCompleteBoxEx that supports ScrollIntoView, so you can hook up the SelectionChanged even and this should get you the behavior you want. I have no idea why this is not baked in. I have had a chance to test out the posted code.

更新

刚刚粘贴从帖子中的代码为一类,并通过改变AutoCompleteBox到AutoCompleteBoxEx并添加命名空间AutoCompleteBoxEx用它在XAML和它工作得很好。您不必指定在XAML任何情况下,也不需要任何的代码添加到后面的代码。

Just pasted the code from the post into a class and used it in the XAML by changing AutoCompleteBox to AutoCompleteBoxEx and adding namespace for AutoCompleteBoxEx and it worked fine. You don't have to specify any event in the XAML, nor do you need to add any code to the code behind.

这篇关于AutoCompleteComboBox箭头向上/向下箭头键来滚动列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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