Everyone gets there... the question is when...
There is this controls array, a property of the System.Windows.Forms.Form. All the controls that are in the form, are listed in the controls array and if you want to remove a particular control from the form, you just call the RemoveAt() method of the control array which will remove the control from the specified index.
Now I had a specific requirement where I was supposed to remove all the textboxes from the control array. So I ran a loop. If the control is a textbox, I would remove it else move on. But every time I call remove(), the indexes would be shuffled. So in case there are adjacent textboxes, I would miss some if I keep going in a sequence.
First thing that comes into my mind. Keep searching for textboxes in a loop until we are sure that there are no textboxes in the collection. For that every time you remove a textboxes, start the loop from zero by resetting the index to -1 (funny...!)