[RESOLVED] TextBoxes and Lables as an array????
Hello! I have a simple query that suppose I have to put values on the lables from a array so instead of writing individual names for assigning values in lables from an array...can I treat Lables as Arrays so that i recogise them by its index for an example.....Here is unmanaged or untrue code....
Code:
label1= a[i];
i++;
label2=a[i];
i++;
label3=a[i];
//So Instead Of above code Is there any way to Use the method of following example??
for(i=0;i<9;i++)
{
label[i]=a[i];
}
Thanks......
Re: TextBoxes and Lables as an array????
Code:
List<Label> labels = new List<Label>( );
labels.Add( new Label( ) );
labels.Add( new Label( ) );
labels.Add( new Label( ) );
int i = 1;
foreach( Label label in labels )
{
label.Text = String.Format( "Label #{0}", i );
++i;
}
Re: TextBoxes and Lables as an array????