title: Load a bitmap image into Windows Forms using open file dialog
body: <p>I need to open the bitmap image in the window form using open file dialog (I will load it from drive). The image should fit in the picture box. </p>
  
  <p>Here is the code I tried:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      var dialog = new OpenFileDialog();
  
      dialog.Title  = "Open Image";
      dialog.Filter = "bmp files (*.bmp)|*.bmp";
  
      if (dialog.ShowDialog() == DialogResult.OK)
      {                     
          var PictureBox1 = new PictureBox();                    
          PictureBox1.Image(dialog.FileName);
      }
  
      dialog.Dispose();
  }
  </code></pre>