That would work, what if I edit the textbox with the thread running ? GUI tries to access the variable while the new thread also does. Textbox1.enabled = false while spamming is a solution.
- - - Updated - - -
If you have some long running code that you want to take down cleanly, aborting is definetely not a solution. It's an emergency solution. In such a small function, there should be no problems however.