I have a C# WPF application I am building. Currently when I run it on my machine in a 1024 x 768 screen resolution environment it all fits. However when I send it to a co-worker he has a 1280 x 800 resolution and the application window runs off the bottom edge of his screen so he cant re-size it or see all of the content in the window. I am running Windows 7 and he is running Windows XP if that makes any difference. In addition in my XAML code I have the ‘Height’ and ‘MinHeight’ attributes both set to 700, so I would think it shouldn’t start out taller than 700.
Any ideas are appreciated, thanks in advance.
WPF specifies sizes and locations in inches, not in pixels. The unit is 1/96 inch. So your Height setting of 700 specifies a window that’s 700 / 96 = 7.292 inch high.
In all likelihood, your co-worker might be wearing glasses and has increased the dots-per-inch setting of his video adapter from 96 to 120 dpi (125% on the ruler) to make it easier to read text. Which makes your window 7.292 * 120 = 875 pixels high. That doesn’t fit the 800 pixels that the monitor can display.
You’ll need to make your window smaller. No more than 800 / 120 * 96 = 640. Less to allow room for the task bar if it is on the bottom. Or preferably support resizable window layouts.