I know how to define an array of int[i], byte[i], and so on. Love it because I can use the for loop to run them. Now I am thinking of doing the same thing with fancy objects like textbox, button, label, etc… I wonder if that is possible.
In case it is, how can that be done? And how will the name of the object be? something like mytextbox[1], mylabel[2]?
That’s exactly right.
Or, you can create an array of type
Controland use it with any sort of control:In order to add these to your Form, you’ll have to add each to the
Controlsproperty of the form dynamically.You’ll have to set the properties of each control in your code behind as well, such as the
Id, theText, etc, as well as theHeight,Width,TopandLeft. That is how you’ll place each control where you want on your form.