Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s As String = "brown monkey hopes not to bark the wrong tree"
Dim ss() As String = Split(s, " ")
For Each s In ss
ListView1.Items.Add(s)
ListBox1.Items.Add(s)
Next
End Sub
Dim li As ListViewItem
Private Sub ListView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDown
li = ListView1.GetItemAt(e.X, e.Y)
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
li.BackColor = Color.DarkBlue
li.ForeColor = Color.White
li.Tag = "monkey" 'selected
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each li In ListView1.Items
li.BackColor = Color.White
li.ForeColor = Color.Black
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For Each li In ListView1.Items
If li.Tag = "monkey" Then
MessageBox.Show(li.Text)
End If
Next
End Sub