Search code examples
c#screen-size

FullPrimaryScreenHeight vs PrimaryScreenHeight?


What is the difference between FullPrimaryScreenHeight and FullPrimaryScreenHeight ?

I don't really get the difference here. I've read also the documentation on MSDN but still...

Can anyone explain it in an understandable way?


Solution

  • The name was chosen poorly. PrimaryScreenHeight gives you the height of the primary monitor, that's pretty straight-forward. FullPrimaryScreenHeight gives you the height of the client area of a maximized window. Which is less than PrimaryScreenHeight by the window's title bar and any taskbar. Beware that this measurement applies only to a "normal" window, it will not be correct if your window doesn't have a title bar or is borderless.

    Furthermore, the MSDN docs are not correct about the unit of measurement. It says the measurement is in pixels but it is actually in units of 1/96 inches. The normal unit of measurement in WPF.