Hi gurus,

Sorry about the lengthy post. I have this question about something in the application I am working on, that has been bugging me.
Here's the scenario.

I have a form with several UI fields. The user enters data in these fields and eventually clicks on a submit button which sends the data for processing to a webservice. The app is such that it can't proceed without getting the return from webservice. However, for some reason, there is a need to make the UI responsive during the Web service call. Here what I do is make an async call to the webservice and then go into a wait loop, with a call to Application.DoEvents, so that any events can be handled.

This is how the code looks...


Code:
private void btnSubmit_Click(object sender, System.EventArgs e)
{
	...
	...
	//Code to retrieve field values from form fields and form Request string...
	ProcessRequest(lstrRequest);
}




public void ProcessRequest(string astrRequest)
{
	
	iHasWSReturned = false;
	AsyncCallback objCallBack = new AsyncCallback(WSCompleted);

	IAsyncResult objAsyncResult = objWS.BeginSubmitRequest(istrProtoCol,astrRequest, objCallBack, objWS);

	while(! iHasWSReturned)
	{
		objAsyncResult.AsyncWaitHandle.WaitOne(500,true);
		Application.DoEvents();
	}
	
	...
	...
	//Further processing...

}


private void WSCompleted(IAsyncResult objAsyncResult)
{
	MYWS.myWS objWS = (MYWS.myWS) objAsyncResult.AsyncState;
	istrMauiRet = "";
	istrMauiRet = objWS.EndSubmitRequest(objAsyncResult);
	iHasWSReturned = true;
}
My question is -
Say, the main UI thread is running the wait loop in the ProcessRequest method. At this point if the user clicks some other button on the UI which fires that button's click event, is
a) a new UI thread created to handle this event? (is it even possible to have multiple UI threads?)
b) Does the UI thread in some way execute both code paths?
c) none of the above

Thanks
Satish