C#中,怎样用变量来表示控件名称
我定义了一组label,label1,label2,label3.....
我现在想通过for 循环来设置 它们的属性
for (int i=0;i<20;i++ )
{
label[i].text="abcd"; //就是这个意思,但是这样表达肯定是不行的
}
请各位大哥指点一下怎么样才能调用呢,我搜到了一些,例如
//tedit(findcomponent("label" +inttostr(i))).Visible=false;
还有vb里面的实现方式,但是在C#中如何实现呢?
谢谢