I know there is a lot of questions about this. I tried them but can't get any result.
I'm creating a thread at first run, when I try to close the form, form closing but application (thread) is still running.
I don't care what will happen to thread. I just want whole application to close when user click to X button. I tried thread_name.Abort(); but nothing happens.
In the absence of code, a full answer is tricky.
I suspect the easiest solution might be to set the Thread's IsBackground property to true.
From the docs:
A thread is either a background thread or a foreground thread. Background threads are identical to foreground threads, except that background threads do not prevent a process from terminating
Try setting Thread.IsBackground to true when you create the thread.
Background threads do not stop the process from terminating if they are running.
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