like this?...
Code:
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
' NOTE: ListBox1.SelectionMode = SelectionMode.One
Static lastIndex As Integer = -1
If ListBox1.SelectedIndex > -1 Then
If lastIndex > -1 Then
If lastIndex = ListBox1.SelectedIndex Then
ListBox1.SelectedIndex = -1
End If
End If
End If
lastIndex = ListBox1.SelectedIndex
End Sub
Edit, or simply?...
Code:
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Static lastIndex As Integer = -1
If lastIndex = ListBox1.SelectedIndex Then
ListBox1.SelectedIndex = -1
End If
lastIndex = ListBox1.SelectedIndex
End Sub