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!");}
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!");}
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
C
C#
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.