I have a table with several labels lbl1, lbl2…., lbl6… numbered serially
I want to access them in a for loop using a index. Here’s my puedocode
//PuedoCode:
int _NUMCOUNT = 6;
string labelname;
string[] strArray = new string[_NUMCOUNT];
//Store some values in strArray
for (int i=0; i<_NUMCOUNT; i++)
{
labelname = "lbl" + (i + 1).ToString();
labelname.Text = strArray[i]
}
Can this be done? I don’t want to use a placeholder & add the labels into it. I already have the labels in a formatted table.
Thanks for the replies. It pointed me in the right direction.
I had to modify the code to