My App edits data on a listview, by clicking on a row then clicking the edit button btnEdit.
Dim PrimaryKey as String
Private Sub ListView1_MouseDoubleClicklstSearch.MouseClick
With .SelectedItems(0)
PrimaryKey = .SubItems(0).Text
End With
End Sub
Private Sub btnEdit_Click
If ListView1.SelectedItems.Count > 0 Then
' Show dialog box
Else
MsgBox("Select First")
End If
End Sub
Edit dialog shows when "Edit" button is click, to make sure there is a selected item to modify I used ListView1.SelectedItems.Count.
Problem is that when I select on a row and disselect it, the SelectedItems.Count is still 1.