I know how to find and collect a list of all the controls used in a Windows Form. Something like this:
static public void FillControls(Control control, List
Surprisingly, it seems the only way to do this is via reflection.
private IEnumerable EnumerateComponents()
{
return from field in GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
where typeof (Component).IsAssignableFrom(field.FieldType)
let component = (Component) field.GetValue(this)
where component != null
select component;
}