我如何让用户用的CheckedListBox通过“转移”键多检查? [英] How do I allow the user to multi-check with the CheckedListBox through the 'shift' key?

查看:114
本文介绍了我如何让用户用的CheckedListBox通过“转移”键多检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有项的CheckedListBox1,2,3,4和5的顺序,我要选择2,3和4 选择2,然后按住Shift键选择4。是否有任何内置的方式与CheckedListBox控件来实现这一目标?我发现如何使用SelectedIndexChanged事件去接近这种行为的文章,但尽管它会检查多个项目,为选中它并没有告诉他们。

Say that I have a CheckedListBox with items "1", "2", "3", "4", and "5" in that order and I want to select "2", "3", and "4" by selecting "2" then holding shift and selecting "4". Is there any built-in way to achieve this with the CheckedListBox control? I found an article on how to use the SelectedIndexChanged event to get close to this behavior, but though it checks multiple items, it does not show them as selected.

http://www.windowsdevelop.com/windows-forms-general/multiple-selection-checkbox-53049.shtml

如果有一个替代控制,我可以用那么我将弥补这一点。

If there is an alternative control that I could use then I would be up for that as well.

推荐答案

有可能是一个更容易的选择,但你可以使用的ListView ,设置的CheckBox 真正 HeaderStyle 查看列表

There might be an easier alternative, but you could use a ListView, set CheckBoxes to true, HeaderStyle to None, and View to List.

更正:

如果已设置查看详细信息

这篇关于我如何让用户用的CheckedListBox通过“转移”键多检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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