Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
TextBox1.Text = ListView1.SelectedItems(0).Text
But I keep getting an Error that I cant figure out.
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
It Works when I select the First thing. Like First Selection no matter what row. But when I go to select another row. It Gives me that Error.
Any Ideas?? Thanks
Selected index changed will raise the event twice when changing. The first one will be a selected index of -1 when its deselecting the current item and the next will be the newly selected index. Its kind of stupid if you ask me. That had troubled me a couple of times.
if selecteditems.count = 0 then exit sub at the top of the sub.