I don't understand why Cursor.Position is different from MouseEventArgs.Location, they should be the same, don't they?
Edit: The answer seems to suggest that Cursor.Position== PointToScreen(MouseEventArgs.Location)
, but my testing indicates otherwise.
MouseEventArgs.Position is the mouse cursor position relative to the control during the event, at the time of the event.
Cursor.Position is the current mouse cursor position relative to the desktop.
MouseEventArgs.location gives you the cursor position relative to the control during the event.
Windows.Forms.Cursor.Position gives you the cursor position relative to the desktop.
Obviously, these two need not be and are not same. The latter can be used without an event as such too unlike MouseEventArgs.Location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With