securonic
Active member
hi everyone.
i have been playing about with the listview control and and been looking at ways of selecting parts of the rows and displaying them in a text box. i have used the following code to do just that but find it will only work if i use a try statement when i decide to reselect a row in the listview.
Private Sub ListView1_SelectedIndexChanged_UsingItems(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ListView1.SelectedIndexChanged
TextBox3.Clear()
Try
TextBox3.Text = ListView1.SelectedItems(0).SubItems(1).Text
Catch exception As Exception
End Try
End Sub
any suggestions?
thanks
i have been playing about with the listview control and and been looking at ways of selecting parts of the rows and displaying them in a text box. i have used the following code to do just that but find it will only work if i use a try statement when i decide to reselect a row in the listview.
Private Sub ListView1_SelectedIndexChanged_UsingItems(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ListView1.SelectedIndexChanged
TextBox3.Clear()
Try
TextBox3.Text = ListView1.SelectedItems(0).SubItems(1).Text
Catch exception As Exception
End Try
End Sub
any suggestions?
thanks