title: Trying to create a grid of pictureboxes in an array for a board in c#
body: <p>I'm trying to make a board for a Naughts and crosses (tic tac toe) game using pictureboxes in an array and what I've come up with is this. This starts when I press a button.</p>
  
  <pre><code>for (int i = 0; i &lt;= 3; i++)
          {
              for (int j = 0; j &lt;= 3; j++)
              {
                  PictureBox[,] pb = new PictureBox[i, j];
                  pb[i, j].Location = new Point(i * 150 + 100, j * 150 + 100);
                  pb[i, j].Width = 150;
                  pb[i, j].Height = 150;
                  pb[i, j].Visible = true;
                  pb[i, j].BorderStyle = BorderStyle.FixedSingle;
                  pb[i, j].BringToFront();
                  this.Controls.Add(pb[i, j]);
              }
          }
  </code></pre>
  
  <p>this throws me a "System.IndexOutOfRangeException" on the line</p>
  
  <pre><code>pb[i, j].Location = new Point(i * 150 + 100, j * 150 + 100);
  </code></pre>
  
  <p>Whats wrong here?</p>