public virtual new void Clear () { all_controls = null; // MS sends remove events in reverse order while (list.Count > 0) { Remove ((Control)list[list.Count - 1]); } }
public static void DisposeChildren(this Control.ControlCollection collection) { if (collection.IsReadOnly) { return; } for (var i = collection.Count - 1; i >= 0; i--) { collection[i].Dispose(); } collection.Clear(); }