Need help with CheckedListBox

  • Thread starter Thread starter Leonid Shirmanov
  • Start date Start date
L

Leonid Shirmanov

Hi!

I have CheckedListBox and one Item with specified index must be always
checked.
Its CheckState can not be changed by mouse click.

How do this?


Thanks in advance,
Leonid.
 
Just handle the ItemCheck event for the CheckedListBox in the following way.

private void checkedListBox1_ItemCheck(object sender,
System.Windows.Forms.ItemCheckEventArgs e)
{
if (e.Index == 1)
{
e.NewValue = CheckState.Checked;
}
}
 
* "Leonid Shirmanov said:
I have CheckedListBox and one Item with specified index must be always
checked.
Its CheckState can not be changed by mouse click.

Try to reset the checked state in the CheckedListBox's 'ItemCheck'
event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top