Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim test1(2) As test
- Dim objtest As New ComboBox
- Private Sub ListView1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListView1.DoubleClick
- Dim test As Integer = Integer.Parse(ListView1.SelectedItems(0).Text)
- If test1(ListView1.FocusedItem.Index).id = test Then
- With test1(ListView1.FocusedItem.Index)
- MessageBox.Show(.id & " " & .name)
- End With
- End If
- End Sub
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- 'populate control
- Dim random As New Random
- Dim num(2) As String
- Dim name() As String = {"bill", "joe", "Steve"}
- Dim c As Integer
- Dim itm As ListViewItem
- c = 0
- Do
- num(0) = random.Next(0, 5)
- num(1) = random.Next(0, 5)
- num(2) = random.Next(0, 5)
- itm = New ListViewItem(num)
- ListView1.Items.Add(itm)
- test1(c) = New test() With {.id = num(0), .name = name(c)}
- c += 1
- Loop Until c = 3
- End Sub
- End Class
Add Comment
Please, Sign In to add comment