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?

Recommended Answers

All 3 Replies

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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.