I know how to get the cursor's position :
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
But this is relative to the screen. How do i get the coordinates relative to my Form?
I know how to get the cursor's position :
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
But this is relative to the screen. How do i get the coordinates relative to my Form?
How about trying like this using the Control.PointToClient:-
Use the
Control.PointToClient
method. Assumingthis
points to the form in question:Or simply:
I would use
PointToClient
like this: