title: VB.NET Threading with Join() method without freezing form
body: <p>Hello I am studying multithreading with join method</p>
  
  <p>I am trying to create multiple threads and run thread in order.</p>
  
  <p>I know that join method is able to join threads and run threads in order.</p>
  
  <p>However, form is updating text box, but whole form is freezing so i can't click any button in the form </p>
  
  <p>Here is code that I have..</p>
  
  <blockquote>
  <pre><code>Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
      Dim T_List As New ArrayList
      Dim VALE As Integer = 99
      For i = 0 To 2
          VALE = i
          t = New Thread(New ThreadStart(Sub() run_t(VALE, 10 + (5 * VALE))))
          t.IsBackground = True
          t.Start()
          t.Join()
          ' T_List.Add(t)
      Next
  
  End Sub
  
  
  Private Sub run_t(t_num As Integer, number As Integer)
      For i = 0 To number
          Thread.Sleep(100)
          CounterBox.AppendText("thread : " &amp; t_num &amp; " : " &amp; i.ToString() + vbNewLine)
          If i Mod 2 = 0 Then
              ComboBox1.Items.Add(i)
          End If
  
      Next
  End Sub
  </code></pre>
  </blockquote>
  
  <p>I was checking "STATHREAD"
  <a href="https://stackoverflow.com/questions/16950316/stathread-and-main-thread">STATHREAD and main thread</a>
  and
  <a href="https://msdn.microsoft.com/en-us/library/ms182351.aspx?cs-save-lang=1&amp;cs-lang=vb#code-snippet-1" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ms182351.aspx?cs-save-lang=1&amp;cs-lang=vb#code-snippet-1</a></p>
  
  <p>however, STATHREAD seems not working for this case.</p>
  
  <p>what can be the solution to use Join method for threads without freezing form..</p>