#671 – Mouse.GetPosition Only Works When Mouse Is in Window

You typically only use the Mouse.GetPosition method when the mouse pointer is within the boundaries of your application’s main window.  When the mouse is located outside of the window, calling GetPosition with a null value will return 0 values for the mouses X and Y position, regardless of where the mouse is located on the screen.

In the example below, we are updating a label to dump out the value returned by Mouse.GetPosition when a timer fires, ever second.

 

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

One Response to #671 – Mouse.GetPosition Only Works When Mouse Is in Window

  1. Pingback: Dew Drop – October 18, 2012 (#1,424) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: