int i = 1;
string[] str ={ "one", "two", "thrie" };
private void button1_Click( object sender, EventArgs e)
{
for ( int j = 0; j < 3; j++)
{
foreach (Control ctemp in this.Controls)
{
if (ctemp.Name == "textBox" + i.ToString())
{
ctemp.Text = str[i - 1];
i++;
}
}
}
}
string[] str ={ "one", "two", "thrie" };
private void button1_Click( object sender, EventArgs e)
{
for ( int j = 0; j < 3; j++)
{
foreach (Control ctemp in this.Controls)
{
if (ctemp.Name == "textBox" + i.ToString())
{
ctemp.Text = str[i - 1];
i++;
}
}
}
}
转载于:https://blog.51cto.com/shenymce/208984