Looping through controls on GUI form ?

  • Thread starter Thread starter Z.K.
  • Start date Start date
Ben said:
No, Arne did an "is" test, which my loop incorporates. You're right
that the Name.StartsWith check would probably be wanted in addition.

Of course, one can always do:

PictureBox pics = { pictureBox1, pictureBox2, pictureBox3 };
foreach (pb in pics) { ... }

Thanks Ben, that worked. I thought it was Peter who actually posted
this code. Anyway, thanks.

Z.K.
 
Back
Top