From Xojo Documentation
Stops the specified thread.
Internally, this method will cause your thread’s stack to unwind, destructors for local objects to be called, and so forth. It's a graceful exit which can cause code to execute. It may also cause context switches.
|A thread should not stop itself. Instead, just return from the Run event handler to allow the thread to end.|
This example, which is in the Action event of a button, stops the thread.