title: How to obtain the maximum screen resolution that a monitor supports using C#
body: <p>I need to obtain the Maximum supported screen resolution of a monitor, not the current resolution which is easy. Any help would be appreciated.</p>
  
  <p><strong>Edit: This is the updated solution that worked for me.</strong></p>
  
  <pre><code>        public Size GetMaximumScreenSizePrimary()
          {
              var scope = new System.Management.ManagementScope();
              var q = new System.Management.ObjectQuery("SELECT * FROM CIM_VideoControllerResolution");
  
              using (var searcher = new System.Management.ManagementObjectSearcher(scope, q))
              {
                  var results = searcher.Get();
                  UInt32 maxHResolution = 0;
                  UInt32 maxVResolution = 0;
  
                  foreach (var item in results)
                  {
                      if ((UInt32)item["HorizontalResolution"] &gt; maxHResolution)
                          maxHResolution = (UInt32)item["HorizontalResolution"];
  
                      if ((UInt32)item["VerticalResolution"] &gt; maxVResolution)
                          maxVResolution = (UInt32)item["VerticalResolution"];
                  }
  
                  log.Debug("Max Supported Resolution " + maxHResolution + "x" + maxVResolution);
              }
              return new Size(maxHResolution, maxVResolution);
          }
  </code></pre>