There is a problem in multithreading within a window form, let me explain it with an example :

private TextBox txtResult;
...
/// Imagine that this is your second thread entry point
public void SecondThread()
{
        ...
        txtResult.Text = "please wait ...";
        ...
}

In this case you will have the same problem and your window app will hang becuase you used one of UI components in thread code. You can't use your UI elements properties and methods in the SecondThread() method.( becuase your window form use single-threaded apartment model ). For more information check this article :
http://msdn.microsoft.com/library/default.asp?url="">

nico_callewaert wrote:

>
>
> Hi,
>
> I'm reading a huge text file into a dataset.  Is there a way to force
> the operating system to process the message queue from time to time
> during that operation, so the end-user will not have the impresiion
> that windows hangs...
>
> Thanks in advance,
>


           
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

[Non-text portions of this message have been removed]


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=224703085


Yahoo! Groups Links

Reply via email to