Stops a thread’s execution immediately and does not allow it to be resumed. The thread must be restarted from the beginning.
thread_object.Abort()
Prerequisites
None
Parameters
None
Remarks
This method stops the thread associated with the object and deallocates internal resources, just as if a console Stop command were issued. The thread cannot be resumed, but can only be restarted using the Start method. If you wish to be able to resume a thread, use the Suspend method instead. If a thread executes the Abort method for itself, the thread exits with an error, but it is not deallocated in the same way as a separate thread
Examples
Dim thread1 As New Thread(“Test”)' Create a thread object to execute the
' procedure Test in the current project
thread1.Start() ' Start the thread
thread1.Abort() ' Stop the thread and prevent resumption.
Thread.CurrentThread.Abort() ' Stops thread in which it is executed
See Also