title: c# Picturebox Array Selection
body: <p>I have created an array of picture boxes and an event for when one is clicked. </p>
  
  <pre><code>   public void TicTac_Load(object sender, EventArgs e)
     {
              PictureBox[] PBox = new PictureBox[9];
              PBox[0] = this.pictureBox1;
              PBox[1] = this.pictureBox2;
              PBox[2] = this.pictureBox3;
              PBox[3] = this.pictureBox4;
              PBox[4] = this.pictureBox5;
              PBox[5] = this.pictureBox6;
              PBox[6] = this.pictureBox7;
              PBox[7] = this.pictureBox8;
              PBox[8] = this.pictureBox9;
          for (int i = 0; i &lt; 9; i++)
          {
              PBox[i].Click += new System.EventHandler(PBoxes_Click);
          }
      }
      public void PBoxes_Click(object sender, EventArgs e)
      {
        PictureBox myPictureBox = sender as PictureBox;
       //if(Pbox[1].click){
       //^^ Looking for something like this 
      }
  </code></pre>
  
  <p>My question is how can I tell which one of my pictureboxes has been clicked as i am unable to access any of them. I would just like to be able to tell which has been clicked inside the method instead of creating many.</p>
  
  <pre><code>pictureBox1_Click(object sender, EventArgs e)
  </code></pre>
  
  <p>Like Events</p>