MotorcycleIke wrote:
I need to name the controls uniquely so I can load/access their items.
Ie: a listbox control.
I need to create a variable number of controls.
I tried to name them like this:
DropListControl ddlControl+ctr = new DropListControl();
One way to go would be to use an array of controls, like this:
int numControls = 20;
DropListControl[] controls = new DropListControl[numControls];
for (int i = 0; i < numControls; i++)
controls[i] = new DropListControl();
Note that you have to create each actual control in turn, the initial
"new" will only create the array itself.
Of course, if you have no idea how many of the controls you are going to
need, it might be better to use a collection type instead of an array. In
that case, you might want to use an ArrayList instead or create your own
typed collection, just like you would for any other data type.
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619
http://www.sturmnet.org/blog