Useful to know – to select items in a ListBox with a right mouse click wire up the following code to the MouseDown event:
private void LB_MouseDown(object sender, MouseEventArgs e)
{
// Select item if right click.
if (MouseButtons.Right == e.Button)
{
Point pt = new Point(e.X, e.Y);
LB.SelectedIndex = LB.IndexFromPoint(pt);
}
}
