title: Required changing in controls like labels at runtime in C #
body: <p><a href="https://i.stack.imgur.com/yEeds.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yEeds.jpg" alt="These are 10 labels on form1 by named label1,label2,....,label10"></a></p>
  
  <p>I want to change labels controls text like if label name is label1 so 1 is odd, the text of label1 should be changed into 1 and if label named is label2 then label text should be changed into 2 and so on.</p>
  
  <p>The following code is not working.</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
      {
         for(int ai =1; ai&lt;=13; ai++)
          {
              if(ai % 2 == 0)
              {
                  Controls["label" + ai.ToString()].Text = ai.ToString ();
              }
  
              else
              {
                 Controls["label" + ai.ToString()].Text = ai.ToString ();
              }
          }
      }
  </code></pre>