The following code does not exit the application. How can I exit the application and make sure all the running threads are closed?
foreach (Form form in Appl
This should work for all threads you opened.
protected override void OnExiting(Object sender, EventArgs args) { base.OnExiting(sender, args); Environment.Exit(Environment.ExitCode); }