// 全选; private void btn_allSelected_Click(object sender, EventArgs e) { //this.CheckedListBox1.CheckOnClick = true; for (int i = 0; i < this.checkedListBox1.Items.Count; i++) { this.checkedListBox1.SetItemChecked(i, true); } } // 全消; private void btn_allCancle_Click(object sender, EventArgs e) { for (int i = 0; i < this.checkedListBox1.Items.Count; i++) { this.checkedListBox1.SetItemChecked(i, false); } } // 反选 private void btn_Unselected_Click(object sender, EventArgs e) { for (int i = 0; i < this.checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i)) { this.checkedListBox1.SetItemChecked(i, false); } else { this.checkedListBox1.SetItemChecked(i, true); } } }
[转载]C# 多选功能(checkedListBox控件)
免责声明:文章转载自《[转载]C# 多选功能(checkedListBox控件)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=