C#中怎么获取TextBox里的内容?

能给我个例子吗?谢谢各位
2024-10-31 02:18:15
推荐回答(5个)
回答1:

比如说要TEXTBOX1内的内容,就只要写TEXTBOX1.text就行了,如果要的数字,就写convert.toint32(textbox1.text)行了

回答2:

static void Main()
{
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{
label1.Text=textBox1.Text;
}

写在按纽事件里自己去看

回答3:

代码如下:

string a=textbox1.Text

a就是文本框里的值

回答4:

直接取TextBox中的Text属性就可以了。如:
string name=TextBox1.Text

回答5:

.Text属性就是取得text的值