Visual Studio Debug does not stop when i close the form that i write in C#. How can i stop debug process when i close form. I added Application.Exit() method in the form closing event but it didn't work.
Thank you.
Try this from here
If (System.Windows.Forms.Application.MessageLoop)
{
// Use this since we are a WinForms app
System.Windows.Forms.Application.Exit()
}
Else
{
// Use this since we are a console app
System.Environment.Exit(1)
}
EDIT:
If there are running infinite
threads then do
Thread myThread = new Thread(...);
myThread.IsBackground = true; //set your running thread to background
myThread.Start(...);
And you can see how to? from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With