void WalkControls(Control container, Control start, int count, bool forward) {
Control ctl;
Console.WriteLine("Walking inside {0},\n starting at control {1}", container.Text, start != null ? start.Text : "null");
ctl = start;
for (int i = 0; i < count; i++) {
ctl = container.GetNextControl(ctl, forward);
if (ctl != null) {
Console.WriteLine("{1} GetNextControl returned {0}, Tabindex: {2}", ctl.Text, i+1, ctl.TabIndex);
} else {
Console.WriteLine("{0} GetNextControl returned NULL", i+1);
}
}
}