title: foreach (Control ctrl in Frm.Controls) in which order it takes controls
body: <p>I am having a peculiar problem with the order in which TextBox controls are added in to the form's Controls property.</p>
  
  <p>Currently, I have the function:</p>
  
  <pre><code> public static bool IsValidate(System.Windows.Forms.Form Frm)
   {
       foreach (Control ctrl in Frm.Controls)                  
           if (ctrl is TextBox)
           //  if (((TextBox)ctrl).AccessibleDescription == "Valid" &amp;&amp; ((TextBox)ctrl).Text == string.Empty)
           if (((TextBox)ctrl).AccessibleDescription == "Valid" &amp;&amp;  ((TextBox)ctrl).Text.Trim()== "")
           {
               MessageBox.Show(((TextBox)ctrl).AccessibleName + " Can't be Blank", Program.companyName, MessageBoxButtons.OK, MessageBoxIcon.Stop);                         
               ((TextBox)ctrl).Focus();
                return false;
           }
           return true;
  }
  </code></pre>
  
  <p>But it's iterating through the textboxes randomly, even though I have set their tab indices.</p>
  
  <p>So I develop the same form again and create the textboxes sequentially. But still, when I pass the form to this function, it's iterating through the textboxes randomly.</p>
  
  <p>I want to know if there is any property of the controls that would allow me to manage their flow.</p>