I read many articles about this, but I still couldn't manage to solve it. I want to select the item of a listbox with MouseEnter event.
It should be something similar like this
Private Sub LBox_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles LBox.MouseDown If e.Button = MouseButtons.Right Then Dim index As Integer = LBox.IndexFromPoint(New Point(e.X, e.Y)) If index >= 0 Then LBox.SelectedItem = LBox.Items(index) Debug.Print(LBox.SelectedItem) End If End If End Sub
Would appreciate your help.