读书人

涉及到 for循跟 量名字的

发布时间: 2011-12-25 23:21:20 作者: rapoo

涉及到 for循和 量名字的
我的程序面 先定了
linklabel1 , linklabel2 , linklabel3 ,linklabel4 ...... linklabel26 一共26

如果我要用for循 它的 linkLabel.Text 值的怎么做
如果平用的,可以 linkLabel[i].Text ,
是在先定好了名字, 那各位大怎么呢?
...

[解决办法]
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(Linklabel))
{
((Linklabel)c).Text = "";
}
}

读书人网 >C#

热点推荐