title: How can a new Form be run on a different thread in C#?
body: <p>I'm just trying to run a new thread each time a button click even occurs which should create a new form. I tried this in the button click event in the MainForm:  </p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      worker1 = new Thread(new ThreadStart(thread1));
      worker2 = new Thread(new ThreadStart(thread2));
  
      worker1.Start();
      worker2.Start();
  }
  
  private void thread1()
  {
      SubForm s = new SubForm();
      s.Show();
  }
  
  private void thread2()
  {
      SubForm s = new SubForm();
      s.Show();
  }
  </code></pre>
  
  <p>The code in the Subform button click event goes like this:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      int max;
      try
      {
          max = Convert.ToInt32(textBox1.Text);
      }
      catch
      {
          MessageBox.Show("Enter numbers", "ERROR");
          return;
      }
  
      progressBar1.Maximum = max;
  
      for ( long i = 0; i &lt; max; i++)
      {
          progressBar1.Value = Convert.ToInt32(i);
      }          
  }
  </code></pre>
  
  <p>Is this the right way? Because I'm trying to open two independent forms, operations in one thread should not affect the other thread.</p>
  
  <p>Or is BackGroundworker the solution to implement this? If yes, can anyone please help me with that?</p>