Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- running on CheckedListBox and check what in the file
- AA
- BB
- CC
- DD
- private void CheckEveryOther_Click(object sender, System.EventArgs e) {
- // Cycle through every item and check every other.
- // Set flag to true to know when this code is being executed. Used in the ItemCheck
- // event handler.
- insideCheckEveryOther = true;
- for (int i = 0; i < checkedListBox1.Items.Count; i++) {
- // here you need to compare with that string....
- checkedListBox1.SetItemCheckState(i, CheckState.Indeterminate);
- else
- checkedListBox1.SetItemChecked(i, true);
- }
- }
- insideCheckEveryOther = false;
- }
- string myStr = "CC";
- for (int it = 0; it < checkedListBox1.Items.Count; it++)
- {
- checkedListBox1.SetItemChecked(
- it, myStr.Contains(checkedListBox1.Items[it].ToString()));
- }
Add Comment
Please, Sign In to add comment