检测Shift/Ctrl和向上/向下箭头 [英] Detect Shift/Ctrl and up/down arrow pressed

查看:648
本文介绍了检测Shift/Ctrl和向上/向下箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有一个包含许多数据的列表框.我喜欢单击一行并按住shift/ctrl键,然后按向上/向下箭头选择另一行,就像我们可以在excel中一样.如何检测是否按下了shift/ctrl和方向键.

谢谢.

Hi I have a listbox with many data. I like to click on a row and hold down shift/ctrl key and press up/down arrow to select another row(s) like we can do in excel. how can i detect shift/ctrl and arrow key pressed.

Thanks.

推荐答案

您不必-ListBox会为您处理.只需将SelectionMode属性设置为MultiSimple或MultiExtended,它将允许Shift和Ctrl起作用.
You don''t have to - the ListBox will handle it for you. Just set the SelectionMode property to MultiSimple or MultiExtended and it will allow Shift and Ctrl to work.


这篇关于检测Shift/Ctrl和向上/向下箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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