title: c# gomoku game label array
body: <p>I am trying to make a simple five in a row (gomoku) game for two players using windows forms and c#. I put a picturebox with a picture and stretched it out on the form. Now I want to put labels at all the intersections on the picture board so a user can click them and change their background color to black or white. </p>
  
  <ol>
  <li><p>How can I make the labels created clickable on the form?</p>
  
  <pre><code>public partial class Form1 : Form
  {
      int labelCount = 0;
      int iteration = 0;
  
      public Form1()
      {
          InitializeComponent();
          Label[] board = new Label[361];
  
          for (int i = 0; i &lt; 361; i++)
          {
              board[i] = new Label
              {
                  Name = "label" + i,
                  Height = 55,
                  Width = 55,
                  MinimumSize = new Size(55, 55),
                  Text = "label " + i
              };
          }
  
          int x = 0;
          int y = 0;
  
          foreach (var Label in board)
          {
              if (x &gt;= 580)
              {
                  x = 0;
                  y = y + Label.Height + 55;
              }
  
              Label.Location = new Point(x, y);
              this.Controls.Add(Label);
              x += Label.Width;
          }        
      }
  }
  </code></pre></li>
  <li><p>Should I make a one-dimensional [361] or two-dimensional array<code>[{A,1}, {A,2}....{D,1}]</code> to easily check for a winner? How can I connect it to the created labels so the array data corresponds to the objects on the board?</p></li>
  </ol>