public
Form3()
{
InitializeComponent();
button1.Click +=
new
EventHandler(button_Click);
button2.Click +=
new
EventHandler(button_Click);
}
private
void
button_Click(
object
sender, EventArgs e)
{
Button btn = sender
as
Button;
MessageBox.Show(btn.Text+
" 点击了一下"
);
}
参考:http://bbs.csdn.net/topics/391960505