I had try to press button with right click, but the button doesn't seen to be pressed like left click.
And so I can't raise the MouseClick event with right click.
private void ButRightClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
MessageBox.Show("Right");
else
MessageBox.Show("Left");
}
But if I change the event to labels, it will work on both right and left click.
private void label2_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
MessageBox.Show("Right");
else
MessageBox.Show("Left");
}
Is there property I need to modify for the buttons?
Or maybe the function is remove, since Microsoft has the Doc(https://learn.microsoft.com/en-us/dotnet/framework/winforms/mouse-events-in-windows-forms)
The following controls do not conform to the standard mouse click event behavior:
Button, CheckBox, ComboBox, and RadioButton controls:
Left click: Click, MouseClick
Right click: No click events raised
Left double-click: Click, MouseClick; Click, MouseClick
Right double-click: No click events raised
Is there no way to use right click on buttons?
Thanks for any help.