title: How do I resize form programmatically using C#?
body: <p>This seems simple enough, and I have followed advice I have found on other posts here. If my picturebox grows to accommodate a large image, I want the form to grow a little more, so there's some whitespace under the photo (otherwise, it looks like the form cropped the photo).  </p>
  
  <pre><code>        if ((pictureBox1.Height + 25) &gt;= this.Height)
          {
              this.Size = new Size(this.Width, (pictureBox1.Height + 35));
              this.Refresh(); // tried with and without refresh 
          }
  </code></pre>
  
  <p>Unfortunately, nothing happens. When going step by step, I see that the Height of the form never changes. I've read here on stack overflow that setting minimum size or maximum size can cause this behaviour, but both are set to their defaults (0,0). </p>
  
  <p>Suggestions? </p>
  
  <p>Thank you</p>