Name
MouseEventArgs
Synopsis
This class encapsulates the data for the
Control.MouseDown,
Control.MouseUp, and
Control.MouseMove events. You can determine the
X and Y coordinates of the
mouse (in client coordinates—contrast this with
Control.MousePosition), the
Button that was pressed (note that this is the
button that caused the event, not the total set of buttons currently
depressed—you should use
Control.MouseButtons for this information).
You can also determine the number of Clicks that
have occurred (i.e., single, double, triple, etc.), and the
Delta through which the mouse wheel has rotated.
public class MouseEventArgs : EventArgs { // Public Constructors public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta); // Public Instance Properties public MouseButtons Button{get; } public int Clicks{get; } public int Delta{get; } public int X{get; } public int Y{get; } }
Hierarchy
System.Object
→ System.EventArgs → MouseEventArgs
Subclasses
StatusBarPanelClickEventArgs
Passed To
Control.{OnMouseWheel(),
RaiseMouseEvent()},
System.Windows.Forms.Design.ComponentTray.{OnMouseDown(), OnMouseMove(), OnMouseUp()}, MouseEventHandler.{BeginInvoke(),
Invoke()}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access