title: VB.NET ShowDialog Form not Ending
body: <p>I converted this app from VB6.  I have 2 forms. Form1 instantiates Form2 via a Menu Item.
  I am having trouble getting Form2 to end when clicking close (X).  If Form2 is 'idle' it closes fine; but if I am in a loop processing anything all the events fire, but it continues processing in Form2. I've tried messing with Dispose, Close, Application.Exit, Application.ExitThread. My last attempt was creating my own event to fire back to Form1 and dispose Form2 -- and it hits it but Form2 is still running. What is the deal?  BTW if I use just Show vs ShowDialog -- Form2 just blinks and disappears.</p>
  
  <pre><code>Form1 does this
  Dim f2 as Import
  :
          Hide()
          f2 = New Import
          AddHandler f2.die, AddressOf killf2
          f2.ShowDialog(Me)
          Show()
  
  Private Sub killf2()
          f2.Dispose()
          f2 = Nothing
  End Sub
  
  Form2
  
  Public Event die()
  Private Shadows Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
          Dispose()
          Close()
          e.Cancel = False
          RaiseEvent die()
  End Sub
  </code></pre>