在原来的C#版本中我们是这样定义Event:
this.Button1.Click += new EventHandler(Button1_Click)
private void Button1_Click(object sender,EventArgs e)
{
//…
}
在现在的2.0版本中有了匿名方法,我们可以将上面的代码这样编写
this.Button1.Click += delegate{
//…
}
Read More