C#: Get complete desktop size?

Timwi picture Timwi · Aug 23, 2009 · Viewed 80.5k times · Source

How do I find out the size of the entire desktop? Not the "working area" and not the "screen resolution", both of which refer to only one screen. I want to find out the total width and height of the virtual desktop of which each monitor is showing only a part.

Answer

Dennis picture Dennis · Nov 8, 2011

You have two options:

  1. PresentationFramework.dll

    SystemParameters.VirtualScreenWidth   
    SystemParameters.VirtualScreenHeight
    
  2. System.Windows.Forms.dll

    SystemInformation.VirtualScreen.Width   
    SystemInformation.VirtualScreen.Height
    

Use the first option if you developing a WPF application.