Terminating Processes

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
Does anyone know how to make a cancel button that can terminate a process which has already begun. For example, If i search a database and it is taking ages to return the results I would like to have a cancel button that can interrupt that search and cancel the process.

Thanks for any help
 
try using threads

Why don't you try using a seperate thread? when you activate the thread to execute your code it will run seperatly and you'll be able to continue to work. When you want to stop the work in the thread simply terminate the thread itself.
Have a look at System.Threading.Thread class
 
Back
Top