我在Form.cs事件处理程序与FormClosingEventArgs
public void label7_Click(object sender, FormClosingEventArgs e)
{
MessageBox.Show("Are you sure you want to exit?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (MessageBox.Show("Are you sure you want to exit?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
e.Cancel = true;
}
else {
Application.Exit();
}
}
有这个闭合形式的代码和验证码在我Form.designer.cs
this.label7.Click += new System.EventHandler(this.label7_Click);
然而,不断出现错误“无过载'label7_Click'与代表'System.EventHandler'匹配'“
我该怎么办?
@dlev如果我删除了'新System.EventHandler()'的东西,当我点击标签,它说明不了什么,因为功能不叫。 – noobprogrammer 2013-04-11 15:12:50