Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged Dim TextInput As String TextInput = InputBox("text") If TextInput = ListBox1.SelectedItem.ToString Then MsgBox("same") Else MsgBox("not same") End If End Sub