Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I check or uncheck all items in a CheckedListBox?

To check all items, you can use code such as:

[C#]

for ( int i=0; i < checkedListBox1.Items.Count; ++i )
  checkedListBox1.SetItemChecked( i, true );

[Visual Basic]

Dim i as Integer
For i = 0 To checkedListBox1.Items.Count - 1
  checkedListBox1.SetItemChecked(i, True)
Next

Contributed from George Shepherd's Windows Forms FAQ



Page view counter