Home  separator  Input  separator  Mouse
Bookmark and Share Share...    Subscribe to this feed Feed   About me...


Mouse Handling in WPF

How to get the Absolute Position of the Mouse on the Screen

You can call Mouse.GetPosition(this) on any WPF element. This function returns the relative offset of the mouse to the upper left corner of your control.

To get the absolute screen cordinates, call the PointToScreen() function.

 
  Point absoluteScreenPos = PointToScreen( Mouse.GetPosition( new Point(), this ));
 
 



 Comments on this article

Show all comments
Johhny Rubber
Commented on 11.August 2009
This is how you do it in WPF NOT JAVA, for gods sake.
David
Commented on 22.February 2010
Thank you very much ! it's so hard to find a good solution to do that !

Name
E-Mail (optional)
Comment
About Christian Moser