title: Current screen resolution in c#
body: <p>How can I get the current screen resolution of the screen where my form is?</p>
  
  <p>I've already tried with primaryScreen but it does not work all times.</p>
  
  <pre><code>this.Size = new Size(Math.Min(width + 19, Screen.PrimaryScreen.WorkingArea.Width), Math.Min(height + dgvActualizar.ColumnHeadersHeight + 40, Screen.PrimaryScreen.WorkingArea.Height));
  </code></pre>