CF listview Checkbox

dashley

Well-known member
Joined
May 27, 2005
Messages
59
Location
Tennessee
Programming Experience
10+
I'm trying to figure out how to test if one or more Checkboxes are checked on my list view.
In the reqular framework (2) I use

VB.NET:
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim item As ListViewItem
Dim checkedItems As ListView.CheckedListViewItemCollection = ListView1.CheckedItems
ForEach item In checkedItems
MsgBox("Test")
Next
EndSub


WHen Im using the CF i find that the CheckedListViewItemCollection isnt avialable and wont work.

How can I test to see if a listview Checkbox or more than one checkbox is checked.


Thanks

 
Last edited by a moderator:
Disregard I figured it out.

VB.NET:
If ListView1.Visible = TrueThen
Dim item As ListViewItem
ForEach item In ListView1.Items
If item.Checked = TrueThen
MsgBox("Test")
EndIf
Next item
EndIf


DASHLEY
 
Last edited by a moderator:
ListView also provides you the SelectedItems property that can be iterated for-each.
 
Back
Top