Share via


CancelMouseEventArgs.CancelMouseEventArgs Constructor

CancelMouseEventArgs.CancelMouseEventArgs Constructor

Initializes a new instance of the CancelMouseEventArgs class.

Definition

Visual Basic .NET Public Sub CancelMouseEventArgs( _
ByVal mb As MouseButtons, _
ByVal clicks As Integer, _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal delta As Integer, _
ByVal cancel As Boolean _
)
C# public CancelMouseEventArgs(
MouseButtons mb,
int clicks,
int x,
int y,
int delta,
bool cancel
);
Managed C++ public: CancelMouseEventArgs(
MouseButtons *mb,
int *clicks,
int *x,
int *y,
int *delta,
bool *cancel
);

Parameters

> > > > > > > > > > > > > > > > > > > > > > >
mb System.Windows.Forms.MouseButtons. A member of the MouseButtons Leave Site enumeration, specifying which mouse button was pressed.

Left1048576 The left mouse button was pressed.
None0 No mouse button was pressed.
Right2097152 The right mouse button was pressed.
Middle4194304 The middle mouse button was pressed.
XButton18388608

The first XButton was pressed.

With Windows 2000, Microsoft is introducing support for the Microsoft IntelliMouse Explorer, which is a mouse with five buttons. The two new mouse buttons (XBUTTON1 and XBUTTON2) provide backward/forward navigation.

XButton216777216

The second XButton was pressed.

With Windows 2000, Microsoft is introducing support for the Microsoft IntelliMouse Explorer, which is a mouse with five buttons. The two new mouse buttons (XBUTTON1 and XBUTTON2) provide backward/forward navigation.

clicksSystem.Int32. The number of times the mouse button was pressed and released.
xSystem.Int32. The x-coordinate, in pixels, of a mouse click.
ySystem.Int32. The y-coordinate, in pixels, of a mouse click.
deltaSystem.Int32. A signed count of the number of detents the mouse wheel has rotated.
cancelSystem.Boolean. Set to true to cancel the event for the parent control; otherwise false.

Remarks

A detent is one notch of the mouse wheel. For more information about detents, see MouseEventArgs.Delta Property Leave Site.

In general, CancelMouseEventArgs objects are obtained from event handlers, so there is no need to call this constructor. However, if you decide to make a custom event involving mouse events that can be cancelled, you could use this class, in which case you would call the constructor when you raise the event.