+
+ if (!ParentForm.IsHandleCreated)
+ return null;
+
+ if (!ParentForm.has_been_visible)
+ return null;
+
+ if (!ParentForm.Visible)
+ return active_child;
+
+ active_child = null;
+ for (int i = 0; i < Controls.Count; i++) {
+ if (Controls [i].Visible) {
+ active_child = (Form) Controls [i];
+ break;
+ }
+ }
+ return active_child;