Getting mouse-position relatively to a control
13,631
Solution 1
Call MyControl.PointToClient()
passing Cursor.Position
.
Solution 2
yourControl.PointToClient(Control.MousePosition)
Author by
Gilad Naaman
Updated on June 12, 2022Comments
-
Gilad Naaman almost 2 years
I'm trying to find a way to get the mouse position relatively to the upper left corner of a control, is there a way to accomplish that?