title: Clear PictureBox - c#
body: <p>I'd like to modify this <a href="http://www.codeproject.com/Articles/21143/PictureBox-Array-in-Visual-Studio-NET" rel="nofollow">PictureBox Array</a> Project.
  i want to put a reset button than will clear all the <code>PictureBox Array</code> it created<br>
  more likely the form will be empty again as like from the beginning. </p>
  
  <p>this is some of it's code;</p>
  
  <pre><code>        // Function to add PictureBox Controls
      private void AddControls(int cNumber)
      {
          imgArray = new System.Windows.Forms.PictureBox[cNumber]; // assign number array 
          for (int i = 0; i &lt; cNumber; i++)
          {
              imgArray[i] = new System.Windows.Forms.PictureBox(); // Initialize one variable
          }
          // When call this function you determine number of controls
      }  
  
      private void ImagesInFolder()
      {
          FileInfo FInfo;
          // Fill the array (imgName) with all images in any folder 
          imgName = Directory.GetFiles(Application.StartupPath  + @"\Images");
          // How many Picture files in this folder
          NumOfFiles = imgName.Length; 
          imgExtension = new string[NumOfFiles];
          for (int i = 0; i &lt; NumOfFiles; i++)
          {
              FInfo = new FileInfo(imgName[i]);
              imgExtension[i] = FInfo.Extension; // We need to know the Extension
              //
          }
      }
  
      private void ShowFolderImages()
      {
          int Xpos = 8; 
          int Ypos = 8;
          Image img;
          Image.GetThumbnailImageAbort myCallback = 
              new Image.GetThumbnailImageAbort(ThumbnailCallback);
          MyProgress.Visible = true;
          MyProgress.Minimum = 1;
          MyProgress.Maximum = NumOfFiles;
          MyProgress.Value = 1;
          MyProgress.Step = 1; 
          string[] Ext = new string [] {".GIF", ".JPG", ".BMP", ".PNG"};
          AddControls(NumOfFiles);
          for (int i = 0; i &lt; NumOfFiles; i++)
          {
              switch (imgExtension[i].ToUpper())
              {
                  case ".JPG":
                  case ".BMP":
                  case ".GIF":
                  case ".PNG":
                      img = Image.FromFile(imgName[i]); // or img = new Bitmap(imgName[i]);
                      imgArray[i].Image = img.GetThumbnailImage(64, 64, myCallback, IntPtr.Zero);
                      img = null;
                      if (Xpos &gt; 432) // six images in a line
                      {
                          Xpos = 8; // leave eight pixels at Left 
                          Ypos = Ypos + 72;  // height of image + 8
                      }
                      imgArray[i].Left = Xpos;
                      imgArray[i].Top = Ypos;
                      imgArray[i].Width = 64;
                      imgArray[i].Height = 64;
                      imgArray[i].Visible = true;
                      // Fill the (Tag) with name and full path of image
                      imgArray[i].Tag = imgName[i]; 
                      imgArray[i].Click += new System.EventHandler(ClickImage);
                      this.BackPanel.Controls.Add(imgArray[i]);
                      Xpos = Xpos + 72; // width of image + 8
                      Application.DoEvents();
                      MyProgress.PerformStep();
                      break;
              }
          }
          MyProgress.Visible = false;
      }
  
      private bool ThumbnailCallback()
      {
          return false;
      }
  
      private void btnLoad_Click(object sender, System.EventArgs e)
      {
          ImagesInFolder(); // Load images
          ShowFolderImages(); // Show images on PictureBox array 
          this.Text = "Click wanted image";
      }
  </code></pre>
  
  <p>how can i do that?</p>
  
  <p>sorry i don't have any code for the reset button yet.<br>
  i don't know what to do, i am new to c#.</p>