private static Control FindControlForward(Control container, Control start) {
Control found;
found = null;
if (start == null) {
return FindFlatForward(container, start);
}
if (start.child_controls != null && start.child_controls.Count > 0 &&
(start == container || !((start is IContainerControl) && start.GetStyle(ControlStyles.ContainerControl)))) {
return FindControlForward(start, null);
}
else {
while (start != container) {
found = FindFlatForward(start.parent, start);
if (found != null) {
return found;
}
start = start.parent;
}
}
return null;
}