Is this VB6, or VB.Net. You have to be more specific.
Assuming it's VB.Net, you want to used
if ListBox1.SelectedItem.ToString() = TextBox2.Text Then...
If it's a multi-aselect listbox, you need to iterate through the selected items, something like this:
foreach item as object in ListBox1.SelectedItems
if (item as string =TextBox2.Text) Then...
Go forth, and code.