I have a really strange problem with a listview on a windows form.I have a listview that lists employees, select an employee and hit the button to bring up a form with their information. If you select an item/click the button going down the listview, the program works correctly. BUT, if you try to select an item above one that you selected before, it will not populate the employee form. What really has me baffled is that it is not consistent, sometimes it works for three different selections, sometimes it only works for two different selections.
Is this a problem with the listview's Index Changed event?
I would appreciate any input here.
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
If ListView1.SelectedItems.Count > 0 Then
empLname = Trim(ListView1.SelectedItems.Item(0).Text)
empFname = Trim(ListView1.SelectedItems.Item(0).SubItems(1).Text)
Dim g As New Guid(ListView1.SelectedItems.Item(0).SubItems(3).Text)
empID = g
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.OKCancel, "Error!")