Switching to the UI context

Posted on 5/17/2014 @ 9:31 AM in #Vanilla .NET by | Feedback | 1306 views

The problem is well known – You cannot update UI thread with another thread.
There are many ways to fix this problem .. but again, stock this in your “bag of tricks”, the simplest way to do it is ..

Change -

   1:  label1.Text = message;

To ..

   1:  label1.Invoke((MethodInvoker) delegate{ label1.Text = message; });

Sound off but keep it civil:

Older comments..