【发布时间】:2021-06-15 12:03:30
【问题描述】:
我正在尝试将一些文本写入一个文本框,其名称基于代码中提到的 num1 和 num2。因此,如果 num1 和 num2 为 0、0,则文本应写入名称为“textbox00”的文本框,类似地,如果 num1 和 num2 为 1、1,则文本应写入“textbox11”。这可能吗?
int num1;
int num2;
if (num1 == 0 && num2 == 0)
{
//Write some text into textBox with name $"textbox{num1}{num2}"
}
谢谢!
【问题讨论】:
-
NameOfYourTextBox.Text = "你的文字";
-
感谢您的链接。这看起来与我的问题相似。
标签: c# textbox windows-forms-designer