FindString CheckListBox

  • Thread starter Thread starter Jorge
  • Start date Start date
J

Jorge

Hello
I have a little problem i have a checkedlistbox with
several repeated items.

The code below only selects the first ocurrence

While reader.Read
For i = 0 To Me.CheckedListBox1.Items.Count - 1
Me.CheckedListBox1.SetItemChecked
(Me.CheckedListBox1.FindString(reader.GetString(0)), True)
Next
End While
reader.Close()

Any suggestion to select all of them?
Thanks

Jorge Cavalheiro
 
Hi Jorge,

I never used the checked listbox, and I know you know enough about this to
find it yourself if you see what you did probably wrong.
The code below only selects the first ocurrence

While reader.Read
For i = 0 To Me.CheckedListBox1.Items.Count - 1
Me.CheckedListBox1.SetItemChecked

Which one you think will be checked except the first, there is not an
indexer?

I think it has to be something as

me.checkedlistbox1.items(i).setitemchecked (I do not know if that is the
right one but that you can see in your intelisense I think.

:-)
(Me.CheckedListBox1.FindString(reader.GetString(0)), True)
Next
End While
reader.Close()
Cor
 
Hi Cor
Good point got to work, thanks
Jorge
-----Original Message-----
Hi Jorge,

I never used the checked listbox, and I know you know enough about this to
find it yourself if you see what you did probably wrong.


Which one you think will be checked except the first, there is not an
indexer?

I think it has to be something as

me.checkedlistbox1.items(i).setitemchecked (I do not know if that is the
right one but that you can see in your intelisense I think.
Cor


.
 
Back
Top