Tag Archives: mouse location

Get the current mouse location (Screen and Client)

To get the current mouse position use the static method Control.MousePosition

It returns a Point structure in screen coordinates. Use PointToClient method of the control to map it to client coordinates.

Example:

Point cp = panel1.PointToClient(Control.MousePosition);

Note:
The PointToClient result may be outside the control’s bounding area if the mouse was not above the control.