开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜