title: Value Dispose() cannot be called while doing CreateHandle() Error when Using Thread
body: <p>//This is my code  </p>
  
  <pre><code>private void btnGenSumm_Click(object sender, EventArgs e)  
  {  
      Thread t1 = new Thread(new ThreadStart(loadSummSales));
      Thread t2 = new Thread(new ThreadStart(showWaitMessage));
      t1.Start();
      t2.Start();  
      }      
  
  private void showWaitMessage()  
  {            
      label1.Text = "Processing please wait!";  
  }      
  
  private void loadSummSales()    
  {  
      try  
      {  
          sqlConn = new SqlConnection(MyClass.GlobalConn());    
  
          string cmdStr = "[dbo].[GetSummary]";    
  
          sqlConn.Open();    
  
          SqlCommand cmd = new SqlCommand(cmdStr, sqlConn);    
  
          cmd.CommandType = CommandType.StoredProcedure;    
          cmd.Parameters.Add("@piDateFrom", SqlDbType.Int).Value = Convert.ToInt32(FromD);    
          cmd.Parameters.Add("@piDateThru", SqlDbType.Int).Value = Convert.ToInt32(ToD);  
  
          System.Data.DataTable dT = new System.Data.DataTable();    
          SqlDataAdapter da = new SqlDataAdapter(cmd);    
          da.Fill(dT);    
          cmd.ExecuteNonQuery();  
          dgSummSales.DataSource = dT;    
  
          dgSummSales.Columns["Branch"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;    
          dgSummSales.Columns["Product Amt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;    
          dgSummSales.Columns["SERVICE Amt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;    
  
          dgSummSales.Columns["Branch"].Width = 270;  
          dgSummSales.Columns["Product Amt"].Width = 98;  
          dgSummSales.Columns["SERVICE Amt"].Width = 103;  
  
          dgSummSales.Columns["Product Amt"].DefaultCellStyle.Format = "N2";  
          dgSummSales.Columns["SERVICE Amt"].DefaultCellStyle.Format = "N2";  
  
          dgSummSales.RowsDefaultCellStyle.BackColor = Color.White;  
          dgSummSales.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine;  
  
          dgSummSales.Refresh();
  
          label1.Text = "Sales as of " + dateTimePicker2.Value.ToString("d", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
      }  
  </code></pre>
  
  <p>//On my first click  btnGenSumm button, it has no error, but on my second try, it gives an error  </p>
  
  <p>Value <code>Dispose()</code> cannot be called while doing <code>CreateHandle()</code>. on <code>Designer.cs</code><br>
  but when I don't used Thread it has no error when I click  <code>btnGenSumm</code> button many times.</p>