Computer Science Canada

Differentiating Click Events

Author:  Raknarg [ Fri Jun 03, 2011 9:45 am ]
Post subject:  Differentiating Click Events

Is there a way to get whether the user is right clicking or left clicking? Is there an event for that or something? I'm doing a minesweeper game, and I wanted a flag to appear when the user right-clicks.

Author:  2goto1 [ Fri Jun 03, 2011 10:06 am ]
Post subject:  RE:Differentiating Click Events

Assuming you're developing a Windows Form app, the Click event is only raised with a left mouse button click. You'd have to use MouseDown or MouseUp. See http://www.homeandlearn.co.uk/net/nets10p2.html for details.

The API reference for Control.MouseUp and Control.MouseDown is helpful to review:

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mouseup.aspx

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousedown.aspx


: