George Shepherd's Windows Forms FAQ
Questions and answers in this FAQ have been collected from newsgroup posts, various mailing lists and the employees of Syncfusion.

33. Windows Forms CheckedListBox

WinForms FAQ Home
   33.1 How do I check/uncheck all items in my checkedlist?



33.1 How do I check/uncheck all items in my checkedlist?


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

C#
for( int i=0 ; i < myCheckedListBox.Items.Count; i++ )
{
myCheckedListBox.SetItemChecked(myCheckedListBox.Items[i], true);
}

VB.NET
For i As Integer = 0 To myCheckedListBox.Items.Count - 1
myCheckedListBox.SetItemChecked(myCheckedListBox.Items(i), True)
Next




© 2001-2010 Copyright Syncfusion Inc. All rights reserved.  |  Privacy Policy  |  Contact  |  Sitemap