I am trying to fix a problem where if a user right clicks on a selection, it will not select/highlight it, and if, for example. "delete", is selected, it deletes the previous selection that was clicked on. I have read many posts about using the mouse_down event, but nothing I have tried has seemed to work for me. Here is the current code:
private void treelocations_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
Point pos = new Point();
pos.X = e.X;
pos.Y = e.Y;
mnulocation.Show(this.treelocations, pos);
}
}
I simply would like to be able to right click on any selection in the list and have it highlight/select that record.