关于c#对象赋值问题!
label6.Text = "A";label7.Text = "B";
label8.Text = "C";
label9.Text = "D";
label10.Text = "E";
label11.Text = "A";
label12.Text = "B";
label13.Text = "C";
label14.Text = "D";
label15.Text = "E";
就这段代码用循环来做应该怎么做呢?
我是学习C#的新手,不知道哪位能帮个忙做一下 --------------------编程问答--------------------
--------------------编程问答-------------------- 好像你刚才删帖了?第一次发提示删帖
Label[] labels = { label6, label7, label8, label9, label10,label11, label12, label13, label14, label15};
int i = 0;
foreach (Label lbl in labels)
{
lbl.Text = ((char)(i++ % 5 + 65)).ToString();
}
补充:.NET技术 , C#