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.
 
Back
Top