title: Invoke form showdialog is not modal
body: <p>I have 2 forms, 1 MainForm and 1 Form2. I am trying to display Form2 as a modal form and background from MainForm. Here's what I have so far.</p>
  
  <p>The default MainForm appears and after 5 seconds it will show Form2 as a Modal form from a background thread. I close Form2 and if the same Form2 shows up again using ShowDialog, the form is not modal. How do I make sure that the Form2 that shows up is always modal?</p>
  
  <pre><code>Public Class MainForm
      Dim frm2 As Form2
      Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
          frm2 = New Form2()
          Dim frmHandle As IntPtr = frm2.Handle
          frm2.Button1.Text = "test"
  
          System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf DoSomething), 0)
      End Sub
  
      Private Sub DoSomething()
  
          'call show dialog first time
          Threading.Thread.Sleep(5000)
          If frm2.InvokeRequired Then
              frm2.Invoke(New Action(AddressOf frm2.ShowDialog))
          Else
              frm2.ShowDialog()
          End If
  
          'call show dialog second time
          If frm2.InvokeRequired Then
              frm2.Invoke(New Action(AddressOf frm2.ShowDialog))
          Else
              frm2.ShowDialog()
          End If
  
      End Sub
  End Class
  </code></pre>