C#开发,需要给EventHandler传递一个参数,写法如下:
cs
string serialNumber = "xxx";
btn.Click += delegate (object sender, EventArgs e) { openForm(sender, e, serialNumber); };
private void openForm(object sender, EventArgs e, string serialNumber)
{
this.serialNumber = serialNumber;
}