This code return a list of controls in a form:
private List<control> _get_all_controls(Control c)
{
List<control> lstC = new List<control>();
foreach (Control ctrl in c.Controls)
{
lstC.Add(ctrl);
lstC.AddRange(_get_all_controls(ctrl));
}
return lstC;
}</control></control></control>