Saturday, May 30, 2009

Visit Every Control on a Form (includes nested controls, no recursion)

// Get the first control in the tab order.
Control ctl = this.GetNextControl(this, true);

while (ctl != null)
{
// Use ctl here.

// Get the next control in the tab order.
ctl = this.GetNextControl(ctl, true);
}

No comments:

Post a Comment