title: C# control array as a method overload
body: <p>In my program there are multiple players who's stats can all be increased at the same time.</p>
  <blockquote>
  <p>Player 1 is represented by staminaTextBox[0] skillTextBox[0] LuckTexBox[0]</p>
  <p>Player 2 is represented by staminaTextBox[1] skillTextBox[1] LuckTexBox[1]</p>
  <p>etc.</p>
  </blockquote>
  <p>I need my <code>IncreaseStat</code> method to deal with 3 different type of Textbox Overload e.g. Stamina, Skill, Luck</p>
  <pre><code>private void StaminaIncBtn_Click(object sender, EventArgs e)
  {
      IncreaseStat(staminaText[0]);
  }
  
  private void LuckIncBtn_Click(object sender, EventArgs e)
  {
      IncreaseStat(luckText[0]);
  }
  
  private void IncreaseStat(TextBox statText)
  {
      for (int i = 0; i &lt; 5 ; i++)
      {
          statText[i].Text = &quot;Altered&quot;;
      }
  }
  </code></pre>
  <p>This method is used to increase all 5 players stats at the same time.</p>
  <p>It works fine if they are not control arrays, however I need them to be. I get the error
  <code>&quot;Cannot apply indexing with [] to an expression of type 'System.Windows.Forms.TextBox&quot;</code>. It applies to that fact that inside the method I am saying <code>statText[i]</code>.</p>
  <p>I do not understand how to get around this problem. Any suggestions would be more than welcome.</p>
  <p>Thank you for your time.</p>