Retrieving from 'Checked ListBox'

samboy29

Member
Joined
Oct 2, 2008
Messages
8
Programming Experience
Beginner
Hello,

I have a CheckedListBox, but I am unsure how to retrieve and save checked items (or unchecked ones, for that matter). Basically I want to be able to retrieve the Items that are checked and save them to an array, but I have been unable to figure out how.

If anyone can show me what the code to perform this, it will be greatly appreciated :D

Thanks for all help in advance.
 
You have a checkedItems collection in the checkedlistbox. You can loop through the collection and save items etc...

e.g

VB.NET:
for i as Integer = 0 to CheckedListBox1.CheckedItems.Count - 1
  Debug.Print(CheckedListBox1.CheckedItems(i).ToString)
next
 
Back
Top