I have a DataGridView with a dgv1.CellClick.
The context menu shows up with the cell is clicked with the left mouse button. When this happens it also sets the position to the current cell BUT the contextmenustrip also shows up when I click on the RIGHT mouse button. I want to disable or hide the context menu when the right mouse button is clicked.
I have tried:
private void dgv1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
cms1.Hide();
}
and this did not work.
Does anyone have any advice?
Best Answer