Previous code when listview sort order change also change it's index, so some items will not be checked or unchecked. In this code I used Selected item. and added a list to store checked items.
Code:
Dim checklist As New List(Of String)()
Private Sub lvwBooks_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lvwBooks.MouseUp
Try
If Not lvwBooks.Items.Count
Thanks for sharing, I've added an option to select only one item at a time, in Mouse_Up event.
Code:
Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
Dim cellLoc As MyCell
cellLoc = WhichCell(ListView1, e.X, e.Y)
If cellLoc.Col = 2 Then
'check once
ListView1.Items(check1_indx).SubItems(1).Text
Leave a comment: