How can I access elements of the main thread in other threads? [duplicate]

0

I'm having this error

  

The operation between threads is not valid: 'LblCheck' control   from a thread other than the thread where it was created.

 Task tarefa = Task.Run(() =>{

  }
  .ContinueWith(t => {
                    LblCheck.Text = "Programa pronto para ser usado!";
                    progressBar1.Value = 100;
 }); 

How can I access elements of the main thread in other threads?

    
asked by anonymous 08.12.2017 / 16:30

0 answers