简体   繁体   English

ListView selectionChanged在键盘导航上触发

[英]ListView selectionChanged fired on keyboard navigation

I have an ListView displaying some items, but when i tab to it and navigates with the keyboard (arrow down) it fires the selection-changed event. 我有一个ListView显示一些项目,但当我选中它并用键盘导航(向下箭头)时,它会触发选择更改的事件。

Can I prevent this so it only fires selectionChanged on "return/enter"-key? 我可以阻止它,所以它只会在“return / enter”-key上激活selectionChanged吗?

Thanks. 谢谢。

You should consider using the ItemClick handler instead of the SelectionChanged handler. 您应该考虑使用ItemClick处理程序而不是SelectionChanged处理程序。 The ItemClick handler is invoked by a left mouse click or by the enter key. 通过鼠标左键单击或输入键调用ItemClick处理程序。

您可以将ListViewIsTabStop属性设置为false,因此它不会以制表符顺序出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM