A button on the parent form is used to start the thread.
If the parent form is closed in the development environment the thread keeps running in the background preventing ed
Environment.Exit(0) terminates this process and gives the underlying operating system the specified exit code. It is more generally used in console applications.