Neomex
Neomex

Reputation: 1670

How to get local mouse position

How can I get local position of cursor?

I want (0,0) point to be in top left corner of my window, not the whole screen.

Upvotes: 3

Views: 1786

Answers (1)

Oleg Dok
Oleg Dok

Reputation: 21776

Cursor.Position class.

If you want to map global mouse position to your window relative position, then use:

YourFormControl.PointToClient(Cursor.Position)

Upvotes: 5

Related Questions