This post shows you how to fix System.InvalidOperationException: 'Cross-thread operation not valid: Control 'lblStatus' accessed from a thread other than the thread it was created on.' in c# windows forms application.

c# InvalidOperationException

Problems occur when you call a control from another thread. To fix the problem, you can modify your code as shown below.

     lblStatus.Text = "Finish";

It wakes up the GUI thread through the mutex and asks it to execute the function (via the function pointer). The parent thread will then wait for the GUI thread to finish executing. And it's done.