Hello Anthony,
Thanks for posting in the community.
Based on my understanding, the question is: How to create, start, pause,
resume, and abort threads? If a form is created in a thread, when the form
exits, does the thread exit?
In MSDN, there is a great part on threading programming. Please refer to
the following link:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthreading.asp?fram
e=true
It includes:
1) Managed Threading Basics
Provides an overview of managed threading and discusses when to use
multiple threads.
2) Using Threads and Threading
Explains how to create, start, pause, resume, and abort threads.
3) Managed Threading Best Practices
Discusses levels of synchronization, how to avoid deadlocks and race
conditions, single-processor and multiprocessor computers, and other
threading issues.
4) Threading Objects and Features
Describes the managed classes you can use to synchronize the activities of
threads and the data of objects accessed on different threads, and provides
an overview of thread pool threads.
I believe it can help you much. For the second question, it depends on how
you lauch the form in that thread. For an example, if you create a WinForm
application from application wizard in VS.NET, the main thread of the
program contains a Form. After the form is disposed by user interactin, the
function of thread execution will quit also. Under this situation, the
thread quits when the form is disposed. However, if the function of thread
has some other tasks to do after the form is disposed, it won't end.
Does that answer your question? If there is anything unclear, please feel
free to post here.
Best regards,
Yanhong Huang
Microsoft Community Support
Get Secure! ¨C
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.