Hi
I have a listview control which is populated by an sql serer source which works fine. What I want is when the control is clicked it shows the value in a message box. The first time after the form is opened it works but if you click the control again I get the message
"Specified argument was out of the range of valid values."
I don't understand what this means. Here is the code for the listview control
Private Sub lstvwUsers_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstvwUsers.SelectedIndexChanged
Dim lvi As ListViewItem = Me.lstvwUsers.SelectedItems(0)
MsgBox(lvi.Text.Trim())
End Sub
Thanks
I have a listview control which is populated by an sql serer source which works fine. What I want is when the control is clicked it shows the value in a message box. The first time after the form is opened it works but if you click the control again I get the message
"Specified argument was out of the range of valid values."
I don't understand what this means. Here is the code for the listview control
Private Sub lstvwUsers_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstvwUsers.SelectedIndexChanged
Dim lvi As ListViewItem = Me.lstvwUsers.SelectedItems(0)
MsgBox(lvi.Text.Trim())
End Sub
Thanks