listview checkboxes not working
I have a listview with checkboxes, when I loop thru it, it always says that all of the items are checked, but they aren't, I step thru it to verify.
For Each lstItem In lsvStations.Items
If lstItem.Checked Then
QString = QString & lstItem.Text & ","
End If
Next lstItem
WHat is wrong,,
THanks for help:confused:
Re: listview checkboxes not working
One more thing, in case it matters, this is in VB.NET
Re: listview checkboxes not working
Quote:
Originally Posted by DebbieInFlorida
One more thing, in case it matters, this is in VB.NET
It does.
Moved.
It also matters what version of VB.NET. Are you using 2005?
Re: listview checkboxes not working
thanks for moving me, old habits are hard to break.. I am using VS 2005
Re: listview checkboxes not working
in .NET you can access a collection of ONLY the checked listviewitems from the listview...
vb Code:
'LOOP CHECKED ITEMS
For Each lstItem In lsvStations.CheckedItems
'ADD ITEM TEXT TO STRING
QString &= lstItem.Text & ","
Next
'TRIM TRAILING "," FROM END OF QString
QString = QString.TrimEnd(","c)
Re: listview checkboxes not working
Thanks Klein,
That looks so obvious. I didn't realize there were so many changes with .NET, have only been in it for a month, but I really like it.
Cheers