![](/img/trans.png)
[英]C# how to input numbers in to the second text box. whenever I click the button it keeps appearing in the 1st textbox
[英]have a prob.I already click the second textbox but it keeps appearing in both. I WANT THE NUMBER TO POP WHEN I CLICK ITS TEXTBOX. 1 at the time
我的代码:
命名空间文本框 { 公共部分类 Form1 : Form { public Form1() { InitializeComponent(); }
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = textBox2.Text += "1";
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
}
}
在您的button1_Click
方法中, textBox1.Text
归因于将 "1" 连接到textBox2.Text
。 我认为这就是你的问题的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.