如何在if语句中更改文本框 [英] How to change textbox within an if statement
本文介绍了如何在if语句中更改文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这很难sya,但我基本上想知道如何更改用于保存行的textBox,例如,类似于如何将变量放在更改字符串的字符串中,使文本框行在第一个循环之后将ffrom文本放入textBox1,改为textBox2(可以使用计数器)。
This is difficult to sya, but I w basically like to know how to change the textBox being used to save lines, for example, similar to how you can put a variable within a string that changes the string, make the textbox line change ffrom text being put into textBox1, into textBox2 after the first loop (could use counter).
if (counter < 5)
{
textBox1 = "A CHANGING VALUE"
counter++;
}
所以也许不知何故,textBox1在使用计数器的第一个循环之后可能成为textBox2?
So maybe somehow, textBox1, could become textBox2 after the first loop using a counter??
推荐答案
简单!
Easy!
TextBox outputTo = textBox1;
for (counter = 0; counter < 10; counter++)
{
outputTo.Text = "A CHANGING VALUE " + counter;
...
outputTo = textBox2;
}
这篇关于如何在if语句中更改文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文