#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.

 

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: