public static bool ValidateControl(Control.ControlCollection controls, Form1 frm)
 {
     foreach (Control cntr in controls)
     {
         if (cntr.HasChildren)
         {
             if (!ValidateControl(cntr.Controls, frm))
             {
                 break;
             }
         }
         else
         {
             cntr.Focus();
             if (!frm.Validate())
             {
                 return true;
             }
         }
     }
     return false;
 }