.net - 检查 CheckedListBox 中的项目而不选择

标签 .net listview winforms checkedlistbox

如何让用户一键点击检查 CheckedListBox 中的一项?默认行为是第一次单击选择该项目,第二次单击允许您切换检查。我也不想切换选择上的检查,我正在寻找 ListView 控件的行为,在其中我可以直接单击复选框来切换它们,而无需先选择其项目。

最佳答案

CheckedListBox 有一个属性 CheckOnClick .

CheckOnClick indicates whether the check box should be toggled whenever an item is selected. The default behavior is to change the selection on the first click, and then have the user click again to apply the check mark. In some instances, however, you might prefer have the item checked as soon as it is clicked.

阅读:How do I CheckOnClick in a CheckedListbox but only when over the checkbox?

关于.net - 检查 CheckedListBox 中的项目而不选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2744541/

相关文章:

android - 在 ListView 项的子项上单击

c# - 如何为 ListviewItem 设置工具提示

linux - 在cmd中用数字重命名txt文件作为文件名

c# - 检测添加到 ComboBox 的项目的事件

c# - 来自类库的引用不会复制到正在运行的项目 bin 文件夹

android - 按字母顺序排序列表

c# - 将 C++ 代码移植到 Silverlight

c# - 如何使用 ComboBox.ObjectCollection.Item() 属性

c# - winforms .Net 关于小方法的使用

c# - Windows 窗体中的 WPF