title: Adding a picture box with a mouse click WinForm
body: <p>At the moment I'm trying to create a black image box that appears when I press my left mouse button. However, when I click, nothing happens. </p>
  
  <p>Could someone please have a look at what I'm doing wrong?</p>
  
  <p>In my Image class:</p>
  
  <pre><code> PictureBox _pictureBoxTag = new PictureBox();
  
      private List&lt;PictureBox&gt; _displayedImage = new List&lt;PictureBox&gt;();
  
      public void AddPictureBox()
      {
          try
          {
              PictureBox _picBox = new PictureBox();
              _picBox.Size = new Size(100, 100);
              _picBox.SizeMode = PictureBoxSizeMode.StretchImage;
              _picBox.BackColor = Color.Black;
              _picBox.Location = new Point(100, 100);
              _displayedImage.Add(_picBox);
  
  
  
          }
          catch (Exception e)
          {
              Trace.WriteLine(e.Message);
          }
      }
  </code></pre>
  
  <p>Then in my Form1.cs class</p>
  
  <pre><code>   HV_Image _testImage;
  _testImage = new HV_Image();
    private void MouseDown( object sender, MouseEventArgs e)
          {
              if (e.Button == MouseButtons.Left)
              {
                  _testImage.AddPictureBox();
                  Trace.WriteLine("Picture box added");
              }
  
              Trace.WriteLine("Mouse Click");
          }
  </code></pre>
  
  <p>My thinking was that my image class should contain a list of picture boxes that get filled out with the required information to create one. E.g size, colour, location etc. Then in my Form1.cs class I simply call the function and it'll draw. </p>
  
  <p>If my way is terrible, or wont work, is there another way in which I can do this? </p>