Windows 表单应用程序 c#
Windows form application c#
我正在用 c# visual studio 设计一个 windows 表单应用程序。例如,我有三个文本框 Textbox1 texbox2 和 textbox3 我希望当用户在 textbox1 中键入一个数字(整数或浮点数)时,当他按下 enter 并显示在 textbox3 中时,它会自动添加到 textbox2 中输入的值中。当 texbox1 和 2 清除时数字添加到 textbox3 中,我该怎么做??提前致谢。
你能试试这个吗(我认为你被错误地标记为 wpf):
//please use Property Window to generate this event
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.textBox2.Text += this.textBox1.Text;
this.textBox1.Clear();
}
}
我正在用 c# visual studio 设计一个 windows 表单应用程序。例如,我有三个文本框 Textbox1 texbox2 和 textbox3 我希望当用户在 textbox1 中键入一个数字(整数或浮点数)时,当他按下 enter 并显示在 textbox3 中时,它会自动添加到 textbox2 中输入的值中。当 texbox1 和 2 清除时数字添加到 textbox3 中,我该怎么做??提前致谢。
你能试试这个吗(我认为你被错误地标记为 wpf):
//please use Property Window to generate this event
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.textBox2.Text += this.textBox1.Text;
this.textBox1.Clear();
}
}