Handle Closing Form?
Hello, I'm having some trouble handling the closing of my form. Currently I'm using the method below, but it for some reason runs 5 times instead of just once.
private bool Closing = false;
Classes Classes = new Classes();
public MainForm()
{
InitializeComponent();
Application.ApplicationExit += new EventHandler(this.Application_ApplicationExit);
}
private void Application_ApplicationExit(object? sender, EventArgs e)
{
Classes.Spark.DebugLog("The app is currently being closed!");
}MainForm MainForm = new MainForm() to access my MainForms controls from my other files. Is there another method I could use to access the MainForms methods/contains without creating a new one?MainForm MainForm = new MainForm()