C#问题,请帮帮我

来源:百度知道 编辑:UC知道 时间:2024/05/29 16:21:27
form1 窗口,同窗口里面的左侧有1个textBox1.text 右侧是临时存储区。我输入AAAA 点提交,则把左侧输入的字符串AAAA写入到右侧临时区,应该怎么写,请帮帮我把,谢谢

双击你的button产生 button_Click事件,在事件里写下面的代码,你的右侧临时区可以是listbox,或textbox或其他的,只要把textbox的text值赋给它们就行了。
private void button_Click(object sender, EventArgs e)
{
string a=textBox1.Text;
listBox.Items.Add(a);
textBox.Text = a;
}

右侧临时区.text =textBox1.text

在提交的事件里写上
右侧.text= this.左侧textbox.tex