I want to combine 2 different button click events in one button click. I have two threads in these two button click events to update text box in winform. When I am trying to combine these two buttons, threads run synchronously but I need thread2 runs after thread1 finishes. How can I do that? I tried doing thread1.start than thread2.start but it did not work because all click event executes at once. Is there anyone to help me? Thanks.
Share
.Net 4:
If you are using .net 4 or later, take a look at Tasks, particularly the ContinueWith method. This is a more uniform approach that is much better.
.Net 1-3.5:
If you are already managing the threading yourself, probably the best way is to have only one thread.
Where the methods are defined as: