My query is about BackgroundWorker
.
I have a windows forms application which starts 10 new threads. Each thread will get some info from 10 different web services. All I need is to append the result from web service call in a rich text box placed in the design mode. How can I make use of background thread in this scenario?
ArrayList threadList;
for (int idx = 0; idx < 10; ++idx)
{
Thread newth= new Thread(new ParameterizedThreadStart(CallWS));
threadList.Add(newth);
}
for (int idx = 0; idx < 10; ++idx)
{
Thread newth= new Thread(new ParameterizedThreadStart(CallWS));
newth.Start(something);
}
for (int idx = 0; idx < 10; ++idx)
{
//Cast form arraylist and join all threads.
}
private void CallWS(object param)
{
// Calling WS
// got the response.
// what should I do to append this to rich text box using background worker.
}
Any help much appreciated.