How to I run multiple threads in VB.NET?
Say I need 2 threads – one that prints 100 numbers in a loop and the second one that asks for the user’s name and prints it inside a message box.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would use 2 BackgroundWorker objects one for each operation that you want to execute. Using the background workers
ProgressChangedevent will ensure that you don’t need to marshal the results back to the UI as the BackgroundWorker already takes care of this for you.