Accessing UI thread of a form?
I'm using C# and I'm making an application where a lot of UI loading must be done in background. Is it possible to do it unsafely and ignore 开发者_JAVA百科InvalidOperationExceptions? The only way I found it to put try...catch statements around every single line of code but this will take ages as there is too much code.
Updating UI directly from threads is a bad thing. If you have multiple threads trying to update, then you are in trouble, If you are sure that only that thread is going to update the UI,
use this before invoking the thread
CheckForIllegalCrossThreadCalls =False
精彩评论