title: C# - Array of Labels that are already on the form?
body: <p>I currently have a windows form which has 24 labels that require updating regularly currently I am do it this way. </p>
  
  <pre><code>private void UpdateLabels()
      {
          // ------------------------------------------------------------------------
          // Group 1 Team 1
          // -------------------------------------------------------------------------
          lblGroup1Team1Points.Text = Convert.ToString(theTeams[0].returnPoints());
          lblGroup1Team1Points.Refresh();
          lblGroup1Team1Wins.Text = Convert.ToString(theTeams[0].returnWins());
          lblGroup1Team1Wins.Refresh();
          lblGroup1Team1Draws.Text = Convert.ToString(theTeams[0].returnDraws());
          lblGroup1Team1Draws.Refresh();
          lblGroup1Team1Loses.Text = Convert.ToString(theTeams[0].returnLoses());
          lblGroup1Team1Loses.Refresh();
          lblGroup1Team1GoalDifference.Text = Convert.ToString(theTeams[0].returnGoalDifference());
          lblGroup1Team1GoalDifference.Refresh();
          lblGroup1Team1Played.Text = Convert.ToString(theTeams[0].returngamesPlayed());
          lblGroup1Team1Played.Refresh();
  
          // ------------------------------------------------------------------------
          // Group 1 Team 2
          // -------------------------------------------------------------------------
          lblGroup1Team2Points.Text = Convert.ToString(theTeams[1].returnPoints());
          lblGroup1Team2Points.Refresh();
          lblGroup1Team2Wins.Text = Convert.ToString(theTeams[1].returnWins());
          lblGroup1Team2Wins.Refresh();
          lblGroup1Team2Draws.Text = Convert.ToString(theTeams[1].returnDraws());
          lblGroup1Team2Draws.Refresh();
          lblGroup1Team2Loses.Text = Convert.ToString(theTeams[1].returnLoses());
          lblGroup1Team2Loses.Refresh();
          lblGroup1Team2GoalDifference.Text = Convert.ToString(theTeams[1].returnGoalDifference());
          lblGroup1Team2GoalDifference.Refresh();
          lblGroup1Team2Played.Text = Convert.ToString(theTeams[1].returngamesPlayed());
          lblGroup1Team2Played.Refresh();
  
          // ------------------------------------------------------------------------
          // Group 1 Team 3
          // -------------------------------------------------------------------------
          lblGroup1Team3Points.Text = Convert.ToString(theTeams[2].returnPoints());
          lblGroup1Team3Points.Refresh();
          lblGroup1Team3Wins.Text = Convert.ToString(theTeams[2].returnWins());
          lblGroup1Team3Wins.Refresh();
          lblGroup1Team3Draws.Text = Convert.ToString(theTeams[2].returnDraws());
          lblGroup1Team3Draws.Refresh();
          lblGroup1Team3Loses.Text = Convert.ToString(theTeams[2].returnLoses());
          lblGroup1Team3Loses.Refresh();
          lblGroup1Team3GoalDifference.Text = Convert.ToString(theTeams[2].returnGoalDifference());
          lblGroup1Team3GoalDifference.Refresh();
          lblGroup1Team3Played.Text = Convert.ToString(theTeams[2].returngamesPlayed());
          lblGroup1Team3Played.Refresh();
  
          // ------------------------------------------------------------------------
          // Group 1 Team 4
          // -------------------------------------------------------------------------
          lblGroup1Team4Points.Text = Convert.ToString(theTeams[3].returnPoints());
          lblGroup1Team4Points.Refresh();
          lblGroup1Team4Wins.Text = Convert.ToString(theTeams[3].returnWins());
          lblGroup1Team4Wins.Refresh();
          lblGroup1Team4Draws.Text = Convert.ToString(theTeams[3].returnDraws());
          lblGroup1Team4Draws.Refresh();
          lblGroup1Team4Loses.Text = Convert.ToString(theTeams[3].returnLoses());
          lblGroup1Team4Loses.Refresh();
          lblGroup1Team4GoalDifference.Text = Convert.ToString(theTeams[3].returnGoalDifference());
          lblGroup1Team4GoalDifference.Refresh();
          lblGroup1Team4Played.Text = Convert.ToString(theTeams[3].returngamesPlayed());
          lblGroup1Team4Played.Refresh();
      }
  </code></pre>
  
  <p>This works great, don't get me wrong but its a rather lengthy process when it comes to updating them when it could be done in some sort of loop - So what I'm asking basically is: Is there anyway to add an existing label to an array of labels so that I can update and refresh these labels just by accessing its element in that label array? My thoughts where it would be as easy as this</p>
  
  <pre><code>Label[,] group1Labels = new Label[5,7];
  private void CreateLabelArray
      {
          group1Labels[0,0] = lblGroup1Team1Points;
      }
  </code></pre>
  
  <p>However I am mistaken as group1Labels gives me the error "A get or set accessor expected" What is the correct way to go about this?</p>