hi there guys I need help how do I make my check box a single click one? I have to double click my checkbox in order to select a particular item but I want to just click once. Any ideas how?

Attachments dsfsdf.jpg 21.53 KB

Add a handler to the SelectedIndexChanged

private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e) {
    int i = checkedListBox1.SelectedIndex;
    checkedListBox1.SetItemChecked(i, !checkedListBox1.GetItemChecked(i));
}

This does have an issue that it's now harder to unselect an item :)

hi there guys I need help how do I make my check box a single click one? I have to double click my checkbox in order to select a particular item but I want to just click once. Any ideas how?

Why are male students charged more?!

By the way, sounds like you are looking for the CheckOnClick property, which should be set to true. Note that this will check the checkboxes if any of the item's text is clicked, or if the checkbox is clicked. If you are fine with this, then it should be easier than Momerath's method.

Edited 5 Years Ago by skatamatic: n/a

Why are male students charged more?!

By the way, sounds like you are looking for the CheckOnClick property, which should be set to true. Note that this will check the checkboxes if any of the item's text is clicked, or if the checkbox is clicked. If you are fine with this, then it should be easier than Momerath's method.

Well it was just a condition given by our professor it doesn't really apply in our school :) thanks for the help!

This article has been dead for over six months. Start a new discussion instead.