【发布时间】:2011-11-02 21:34:43
【问题描述】:
假设我有 10 个文本框,我想在每个文本框中输入相同的文本。我不想写十遍textBoxNum. Text = "hello!",所以我可能会写这样的东西:
for(int i=1; i<=10; i++)
{
textBox + i. Text = "hello!";
}
显然,它不起作用。
如何使用for 循环来完成此操作?
【问题讨论】:
-
你应该为你的文本框命名。
标签: c# winforms textbox for-loop