I’ve done some research and I can’t really find a preferred way to do updating of form controls from a worker thread in C#. I know about the BackgroundWorker component, but what is the best way to do it without using the BackgroundWorker component?
Share
There’s a general rule of thumb that says don’t update the UI from any thread other than the UI thread itself. Using the features of the BackgroundWorker is a good idea, but you don’t want to and something is happening on a different thread, you should do an ‘Invoke’ or BeginInvoke to force the delegate to execute the method on the UI thread.
Edit: Jon B made this good point in the comments:
Some simple example code:
The code above is from a FAQ about it here and a longer more involved one here.