Let's say I have
Label1
Label2
Label3
I want to do something like:
for(int i=0;i<3;i++)
{
LabelArray[i].Text = "weee!";
}
To populate the array, I know I can do something like:
LabelArray[0] = Label1;
LabelArray[1] = Label2;
LabelArray[2] = Label3;
But that doesn't seem smart just because I have 50 labels, and that would be 50 silly lines of code.
Is there a better way to do this?
Thanks!