Hi. I have a listbox (LBProd) that is populated at form load from a text file using:

Dim Prods() As String = IO.File.ReadAllLines("E:\Rajja\TxtFiles\Product1.txt")
LBProd.Items.AddRange(Prods)

It's an extensive list! There is a Textbox into which the user can start to type the name of a product and it will highlight the product in the listbox.

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles tb1.TextChanged

Dim i As Integer = LBProd.FindString(tb1.Text)
LBProd.SelectedIndex = i
If tb1.Text = "" Then
LBProd.SelectedIndex = -1
End If

End Sub

The user can then select the product in the listbox from the list of matches; but, having selected the product I need to retrieve the index of that selection in the list to use in the next stage of the program, but I'm struggling to get the index when the user clicks the selection in the listbox.

Would be grateful for any suggestions and thanks in advance.