I have a program that uses multiple forms and I want to be able to terminate the application from form 2 so that its no longer running or debugging.
This is the code that I have tried:
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1 frm = new Form1();
frm.Close();
this.Close();
}
Using the above code closes the forms but does not stop the debug process and I’m not sure if this is an issue!
If you want to close the entire application you may call
Application.Exit.