You don't. A right-click is a mousebutton event, and the MouseEventArgs
class has properties that will enable you to tell if its was a right-button
click. Your event handling code can then react to this programmatically.
a) If you want to invoke a system event that is a mouse right-click you
need to use the Win32 API via DLL p/Invoke.
b) If you just need to catch the event hook on the MouseClick or
MouseDown or MouseUp event and react to the member Button given by the
event:
public void OnMouseClick(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
// place your code here
}
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.