IgnaceMaes / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
2.84k stars 829 forks source link

Support for background workers/multithread applications #172

Open Zkore opened 6 years ago

Zkore commented 6 years ago

Adding a control into a usercontrol which gets called from a background worker gives cross-thread exceptions due to non-thread safe methods it seems, perhaps I could modify the methods for thread safety, but I couldn't find the code for VB .Net in the repository.

IgnaceMaes commented 6 years ago

The UI shouldn't be modified from a thread other than the main thread. Perhaps you're not invoking correctly? (quickly googled a VB.Net example on the subject) If that's not the case, let me know.

PS: MaterialSkin is written solely in c#. Since both c# and VB.Net compile to CIL (Common Intermediate Language), the library can be used for both.

Zkore commented 6 years ago

Thanks for the info. As far as I am aware my invoke methods are working correctly (due to I use them to add other user controls) and it only throws the exception on the one that contains an element from MaterialSkin (in this case, I was testing with a radiobutton).

IgnaceMaes commented 6 years ago

I see. Could you perhaps post some more information:

That would make it easier to see what's going wrong.