title: Loop through Textboxes
body: <p>I have a winforms app that has 37 textboxes on the screen. Each one is sequentially numbered:</p>
  
  <pre><code>DateTextBox0
  DateTextBox1 ...
  DateTextBox37
  </code></pre>
  
  <p>I am trying to iterate through the text boxes and assign a value to each one:</p>
  
  <pre><code>int month = MonthYearPicker.Value.Month;
  int year = MonthYearPicker.Value.Year;
  int numberOfDays = DateTime.DaysInMonth(year, month);
  
  m_MonthStartDate = new DateTime(year, month, 1);
  m_MonthEndDate = new DateTime(year, month, numberOfDays);
  
  DayOfWeek monthStartDayOfWeek = m_MonthStartDate.DayOfWeek;
  int daysOffset = Math.Abs(DayOfWeek.Sunday - monthStartDayOfWeek);
  
  for (int i = 0; i &lt;= (numberOfDays - 1); i++)
  {
   //Here is where I want to loop through the textboxes and assign values based on the 'i' value
     DateTextBox(daysOffset + i) = m_MonthStartDate.AddDays(i).Day.ToString();
  }
  </code></pre>
  
  <p>Let me clarify that these textboxes appear on separate panels (37 of them). So in order for me to loop through using a foreach, I have to loop through the primary controls (the panels), then loop through the controls on the panels.  It starts getting complicated.</p>
  
  <p>Any suggestions on how I can assign this value to the textbox?</p>