VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each item As Object In Me.ListBox1.Items
If Me.ListBox1.GetItemText(item) = Me.TextBox1.Text Then
MessageBox.Show("We have a match!")
Exit For
End If
Next item
End Sub
Is that the sort of thing you want to do? This is a simple example but the principle can be extrapolated to any number of scenarios. You could use a For loop instead of a For Each loop if you need to know the index of the matching item. I've also used GetItemText to account for the fact that a ListBox can contain items of any type. If you have added String objects to the ListBox then you can just use the items themselves directly, but using GetItemText is a good policy as it will work in absolutely any case.