Here’s the WinForms scenario:

You have a listbox which has a context menu. If you try to right-click and item AND choose from the context menu, normal functionality will not choose the item you are actually selecting with your mouse. Normally, you would need to select the item with the left button and then use the right-button on that item to get your context menu. Although irritating, that’s the way it’s been since before VB6.

However, the fix is easy. All you need to do is to create a mouse down event for your listbox and add an if/then statement:

C#
private void YourListBoxName_MouseDown(object sender, MouseEventArgs e)
{
          if ((e.Button == MouseButtons.Right))
            {
                YourListBoxName.SelectedIndex = YourListBoxName.IndexFromPoint(e.X, e.Y);
            }
}
VB
Private Sub YourListBoxName_MouseDown(sender As Object, e As MouseEventArgs)
	If (e.Button = MouseButtons.Right) Then
		YourListBoxName.SelectedIndex = YourListBoxName.IndexFromPoint(e.X, e.Y)
	End If
End Sub