SOS......请大侠慷慨相助
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
((Button)sender).Click += new EventHandler(YunSuan);
}
private void YunSuan(object sender, EventArgs e)
{
textBox1.Text += ((Button)sender).Text;
}
}
}
为什么第一次按 button(button.text=1) textBox1.Text 显示的是 1
第二次同样按 button(button.text=1) textBox1.Text 显示的是 111 而不是11
也就是说 同样的按钮 你按几次 textBox1.Text 就增加了相同次数的1 而不是只增加 一个1
why?