Thread Extensions for Invoking WinForm-Controls

Yes, I know WinForms is an outdated task of Microsoft and Wpf is the future. But most of the developer have honor to maintain WinForm project. WinForm controls have the boring feature that it is not possible to access from a foreign thread context to set the WinForm properties. If you do that you get a friendly exception and the application terminates, which is not a wanted function for the customers. To reach a stable application an Invoke-Call might solve this issue. For that I wrote a tread extension class which allows Invoked calls in several ways. Some code parts are from the web and some I developed by myself. For those which are still on WinForms this code part might help to synchronize data with controls.


Print Friendly, PDF & Email