T
Tim Burr
I am trying to make it so when a user clicks on an item in a listview
that 3 textboxes are populated.
Here is what I have so far:
Private Sub ListView1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ListView1.SelectedIndexChanged
If ListView1.SelectedIndices.Count > 0 Then
Dim lvi As ListViewItem = ListView1.SelectedItems(0)
TextBox1.Text = lvi.Text
TextBox2.Text = lvi.SubItems(1).Text
TextBox3.Text = lvi.SubItems(2).Text
End If
End Sub
I get an error as follows:
'SelectedItems' is not a member of 'System.Windows.Forms.ListView'.
Is there another way to do this?
Thanks
TB
that 3 textboxes are populated.
Here is what I have so far:
Private Sub ListView1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ListView1.SelectedIndexChanged
If ListView1.SelectedIndices.Count > 0 Then
Dim lvi As ListViewItem = ListView1.SelectedItems(0)
TextBox1.Text = lvi.Text
TextBox2.Text = lvi.SubItems(1).Text
TextBox3.Text = lvi.SubItems(2).Text
End If
End Sub
I get an error as follows:
'SelectedItems' is not a member of 'System.Windows.Forms.ListView'.
Is there another way to do this?
Thanks
TB