title: How can I change size of PictureBox?
body: <pre><code>partial class Form1
  {       
  
      //hidden
  
      private void InitializeComponent()
      {
          this.picture = new System.Windows.Forms.PictureBox();
  
          //hidden
  
          this.picture.Size = new System.Drawing.Size(1, 1);
  
          //hidden
      }
  
      #endregion
  
      private System.Windows.Forms.PictureBox picture;
      private System.Windows.Forms.Button btnLoad;
      private System.Windows.Forms.OpenFileDialog dgOpenFile;
      private System.Windows.Forms.Panel panel1;
  }  
  </code></pre>
  
  <p><code>---</code>  </p>
  
  <pre><code>public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {            
      }
  
      private void btnLoad_Click(object sender, EventArgs e)
      {
          if (dgOpenFile.ShowDialog() == DialogResult.OK)
          {
              Bitmap img = new Bitmap(dgOpenFile.FileName);
              picture.Width = img.Width;
              picture.Height = img.Height;
              picture.Image = img;
          }
      }
  }
  </code></pre>
  
  <p>Why the size of <code>PictureBox</code> stays (1, 1) and doesn't change to the size of image?</p>