I want to create a control array but I would like to do so by drawing them in design mode. I know how to create control array with code but then I have to manually type the x,y for each control. I have a program with 50+ controls.
Any ideas?
Printable View
I want to create a control array but I would like to do so by drawing them in design mode. I know how to create control array with code but then I have to manually type the x,y for each control. I have a program with 50+ controls.
Any ideas?
You cant create a control array during design time, maybe you could group all the controls together on one panel and index them like so...
int i = 0;
foreach(Control c in panel1.Controls)
{
c.Text = i.ToString();
i++;
}
or even like this...
panel1.Controls[0].Text = string.Empty;
You can just make an array of controls.
textbox[] boxes = new textbox[5];
...
yeah i knew that .... i just didnt want to set the x, y for 50+ controls