title: Cross-thread operation not valid in background worker c#
body: <p>I want a code running in background worker but encountered this error :</p>
  
  <blockquote>
    <p>'Cross-thread operation not valid: Control 'metroComboBox1' accessed from a thread other than the thread it was created on.' </p>
  </blockquote>
  
  <pre><code>private void metroRename_Click(object sender, EventArgs e)
      {
          if (backgroundWorker1.IsBusy)
              backgroundWorker1.CancelAsync();
          backgroundWorker1.RunWorkerAsync(metroComboBox1.Text);
      }
  
  private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
      {
          this.Invoke((MethodInvoker)delegate ()
          {
              string text = metroComboBox1.Text;
          });
  
          if (metroComboBox1.SelectedItem == "TITLE") //error here
          {
             //some code here
          }
      }
  </code></pre>
  
  <p>How can I use combobox inside the background worker?</p>