title: using dynamically created labels c#
body: <p>So I have </p>
  
  <pre><code>TableLayoutPanel table = new System.Windows.Forms.TableLayoutPanel();
  public int d;
  private void button1_Click(object sender, EventArgs e)
  {
      d = (int)numericUpDown1.Value;
      table.ColumnCount = d;
      table.RowCount = d;
      this.Controls.Add(table);
      int k = 1;
      for (int i = 0; i &lt; d; ++i)
          for (int j = 0; j &lt; d; j++)
          {
              Label lab = new System.Windows.Forms.Label();
              lab.Size = new Size(50, 50);
              lab.Text = (k).ToString();
              lab.TabIndex = k++;
              lab.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
              table.Controls.Add(lab, j, i);
          }
      table.Show();
  }
  </code></pre>
  
  <p>That is one Button Click method. 
  I have Button2 Click method and I want to change lab.TabIndex or/and lab.Text.
  How can I do that?</p>
  
  <p>And second question:
  how can i do something on Click one of that labels? Let's say that i want to change a color one of the labels i click...how can I do that?</p>
  
  <p>I'm a beginner so...have mercy :)</p>