Hi eric,
You can keep them referenced on a ArrayList the thing is how to know what
to place on each one, you have to think about it,
if you want to use the designer and still be able to treat them as a whole
you could iterate in the Controls collection after the controls are created
and if the control is a ListBox add it to the ArrayList.
One advice, the loading of this form can be very slow, as the designer code
may not be the best way for doing so. if you do not need keep an individual
reference I would recommend you to change the code of the designer, once you
finish designing it.
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Eric" <an*******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I have a form that has 156 list boxes on it. Is there a way to refer to
each on in a for loop to populate their data instead of writing code for
each one?
for example:
for(int x;x < 156;x++)
listBox x = something
instead of
listBox1 = something
listBox2 = something
...
listBox156 = something