المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Genericize access to variables



C# Programming
09-02-2010, 01:13 AM
I googled this extensively yesterday and didn't come out with an answer:

Is it possible to do some thing like this, and if so how?

labela1.Text = "something";
labela2.Text = "something";
labela3.Text = "something";

Now what I want is a way to write that code as say:

for (int i=1;i