I add items to a checkedListbox from a file as such:
As I am adding the item to the checkedListbox I want to set its property to checked if it is in the "Else" clause above. My issue is that once I add the item how do I refer to the item I just added in order to set its property without having to iterate through the whole box?Code:While Not myInputString Is Nothing currentFields = Split(myInputString, ",") If currentFields(1) = "0" Then lstApts.Items.Add(currentFields(0)) Else lstApts.Items.Add(currentFields(0)) ' I WANT TO CHECK THE ITEM THATS IN THIS ELSE CLAUSE End If rowCount += 1 ' Read the next line. myInputString = myStreamReader.ReadLine() End While


Reply With Quote
