title: How to display a PictureBox from behind code in C#
body: <p>I know my question sounds basic, but i searched all over the place and found nothing..
  this is my code :</p>
  
  <pre><code>public MainWindow()
  {
      InitializeComponent();
  
      Map newMap = new Map();
      newMap.setMapStrategy(new SmallMapStrategy());
      newMap.createMap();
  
  
      System.Windows.Forms.PictureBox pictureBox1 = new System.Windows.Forms.PictureBox();
      pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(newMap.grid[3].afficher);
  
  }
  </code></pre>
  
  <p>this is the afficher function :</p>
  
  <pre><code>public override void afficher(object sender, PaintEventArgs e)
  {
      e.Graphics.DrawImage(squareImage, pos_x, pos_y, 50, 50);
  }
  </code></pre>
  
  <p>squareImage is an attribute corresponding to a Drawing.Image.
  pos_x and pos_y are custom int32 attributes.</p>
  
  <p>What i'd like is to SEE the image while running my application...</p>