Dynamically adding controls to a Collection
Posted on 2006-11-03
I need to dynamically (at run time) create a large amount of textboxes. I want to create a loop which adds the controls (textboxes in this case) to a collection. How can I do this? I know I can loop through and create differest control names, text, etc., but I can't figure out how to use a loop to generate different actual controls. As an example:
I tried this:
for i = 1 to txtBoxAmt
txtBoxCollection.add(textbox1) . . . . I can't modify "textbox1" using the count varible "i". Any ideas?
textbox1.name = "name" & i"
textbox1.text = "text" & i"
Please help. THANKS!