title: Filling a dictionary with numbers from textbox and with the textboxes as keys
body: <p>I'm writing a code where I want to get the numbers from multiple <code>TextBox</code> controls into a collection. Sort it, then change the background color of the textboxes containing the top 3 highest value. This is the dictionary</p>
  
  <pre><code>Dictionary&lt;System.Windows.Forms.TextBox, string&gt; all_cycles = new Dictionary&lt;System.Windows.Forms.TextBox, string&gt;(10);
  for (var i = 1; i &lt; 5; i++)
  {
      all_cycles.Add(((System.Windows.Forms.TextBox)this.Controls.Find("txtendc" + Convert.ToString(i), true)[0]),this.Text);
  }
  </code></pre>
  
  <p>I know that with "this.text" I won't get the textboxes values so that's why I'm asking.
  I also tried creating an array which only contains the values of the textboxes which I then use to fill the dictionary. But it always drops an Index was outside the bounds of the array. Or Index was out of range exception. This drops the out of range exception:</p>
  
  <pre><code>List&lt;System.Windows.Forms.TextBox&gt; txtendc = new List&lt;System.Windows.Forms.TextBox&gt;(10);
  for (var i = 1; i &lt; 5; i++)
  {
      txtendc.Add((System.Windows.Forms.TextBox)this.Controls.Find("txtendc" + Convert.ToString(i), true)[0]);
  }
  int[] endc_content = new int[10];
  for (var i = 1;i &lt; 5; i++)
  {
      endc_content[i]= int.Parse(txtendc[i].Text);
  }
  </code></pre>
  
  <p>I don't have any problem with the coloring, just filling up the dictionary. If you have a better solution than the dictionary collection please tell me.
  Thanks</p>
  
  <p>EDIT: This whole code is inside a timer tick event if it matters anything</p>