Okay so I know how to close the application completely but when I have multiple forms it tends to mess up my main form and cause bugs when I close my secondary forms. Can anyone help me with this problem?
// The bug I get is in Program.cs and it is with this line;
Application.Run(new Form1());
// The bug it tells me is occurring is:
// Cannot access a disposed object.
// Object name: 'ShapeContainer'.
// The way the user exits the form is by clicking a red spherical graphic;
// Also known as 'OvalShape' in the toolbox;
// This is the snippet that closes my current form;
void exitBrowser(object sender, EventArgs e)
{
this.Close();
}
Any help to fix it is appreciated. As far as I know it's no application fatal but it pauses the debugging sessions when I exit the form.