How to create Control array?
-
I wish to create quite a number of TextBox controls in a form. Is there anyway I can create a array of TextBox controls, so the controls can be updated by calling the array control with index. for example I can update all the TextBox Text by the following code:
int i=0; foreach(TextBox txtBox in txtBoxes) { i++; txtBox.Text = "Control " + i; }
where txtBoxes is a array of all the TextBox controls in the form.;)*12Code
-
I wish to create quite a number of TextBox controls in a form. Is there anyway I can create a array of TextBox controls, so the controls can be updated by calling the array control with index. for example I can update all the TextBox Text by the following code:
int i=0; foreach(TextBox txtBox in txtBoxes) { i++; txtBox.Text = "Control " + i; }
where txtBoxes is a array of all the TextBox controls in the form.;)*12Code