我知道在 Form.Designer.cs 中单击按钮的标准代码是:
this.button1.Click += new System.EventHandler(this.button_Click);
以及格式中的标准代码:
private void button_Click(object sender, EventArgs e)
{
}
将变量从 Form.Designer.cs 传递给 Form 的方法是什么?是否可以写:
private void button_Click(object sender, EventArgs e, int variable)
{
}
在表单设计器中,我尝试编写
this.button1.Click += new System.EventHandler(this.button_Click(,,1);
但它要求我声明 object sender 和 EventArgs e,而我不知道该放什么。