Hello,
I am wondering if there is a way of performing macro subsitution in C#? I used to do this in Fox Pro and it is basically replacing one variable for another. Here is an example of what I am trying to do:
I have five label controls on my form lbl1 - lbl5. I want to access each of these in a loop and change their text values.
loop 5 times
cnt++;
x = "lbl" + cnt;
x.Text = "text for label " + cnt
endloop
I think I can accomplish this by creating the label controls at runtime, but I am curious if C# has something similar to macro subsitution.
Thanks for your help,
Bill
I am wondering if there is a way of performing macro subsitution in C#? I used to do this in Fox Pro and it is basically replacing one variable for another. Here is an example of what I am trying to do:
I have five label controls on my form lbl1 - lbl5. I want to access each of these in a loop and change their text values.
loop 5 times
cnt++;
x = "lbl" + cnt;
x.Text = "text for label " + cnt
endloop
I think I can accomplish this by creating the label controls at runtime, but I am curious if C# has something similar to macro subsitution.
Thanks for your help,
Bill