1, I'm _click () to add this. FormClosing
public _click ()
{
InitializeComponent();
Enclosing FormClosing +=new FormClosingEventHandler (Form1_FormClosing);
}
2, and then in FORM1. C, add close form event code
private void Form1_FormClosing (object sender, FormClosingEventArgs e)
{
}
But the Visual Studio 2017 error, why?
CodePudding user response:
Do you want to write Form1 - FormClosing the events in class, what is your current is directly in the namespaceCodePudding user response:
Are you directly put the method in the namespace, not in the class