I have this closing form code in my Form.cs
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();
}
}
and this code in my Form.designer.cs
this.label7.Click += new System.EventHandler(this.label7_Click);
However it keeps showing error "No overload for 'label7_Click' matches delegate 'System.EventHandler'"
What should I do?