Hi, You cannot access UI thread straight away from another thread, UI thread has highest priority. You need to use dispatcher to do it.
just change your
labelWrite(string text) method,
private void labelWrite(string text)
{
Task.Delay(10000).Wait();
this.Invoke(new MethodInvoker(delegate ()
{
label1.Text = text;
}));
}
And call this method in Button Click. Always try to use dispatcher when you need to update UI from threads.