title: c# picturebox to control not working
body: <p>I am following a tutorial on how to make a recursive maze in c#.
  this is the tutorial: <a href="http://www.c-sharpcorner.com/uploadfile/4a950c/solving-mazes-using-recursion/" rel="nofollow noreferrer">http://www.c-sharpcorner.com/uploadfile/4a950c/solving-mazes-using-recursion/</a></p>
  
  <p>i was following these steps,but I can't get any further because when I run this code, the picture boxes won't show up as in the tutorial.</p>
  
  <p>this is the part where they should be made:</p>
  
  <pre><code>private void createNewMaze()
      {
          mazeTiles = new PictureBox[XTILES, YTILES];
          //Loop for getting all tiles
          for (int i = 0; i &lt; XTILES; i++)
          {
              for (int j = 0; j &lt; YTILES; j++)
              {
                  //initialize a new PictureBox array at cordinate XTILES, YTILES
                  mazeTiles[i, j] = new PictureBox();
                  //calculate size and location
                  int xPosition = (i * TILESIZE) ; //13 is padding from left
                  int yPosition = (j * TILESIZE) ; //45 is padding from top
                  mazeTiles[i, j].SetBounds(xPosition, yPosition, TILESIZE, TILESIZE);
                  //make top left and right bottom corner light blue. Used for start and finish
                  if ((i == 0 &amp;&amp; j == 0) || (i == XTILES - 1 &amp;&amp; j == YTILES - 1))
                      mazeTiles[i, j].BackColor = Color.LightBlue;
                  else
                  {
                      //make all other tiles white
                      mazeTiles[i, j].BackColor = Color.White;
                      //make it clickable
                      EventHandler clickEvent = new EventHandler(PictureBox_Click);
                      mazeTiles[i, j].Click += clickEvent; // += used in case other events are used
  
                  }
                  //Add to controls to form (display picture box)
                 this.Controls.Add(mazeTiles[i, j]);
  
              } 
          }
      }
  </code></pre>
  
  <p>this is what i get:
  <a href="https://i.stack.imgur.com/FLsjF.png" rel="nofollow noreferrer">Maze</a></p>
  
  <p>i can't find the solution, maybe someone can, thanks in advance. </p>