title: VB.NET - Interrupt form loop and end form
body: <p>I have a form that goes through an endless loop and processes data. When I click a button that "closes" the form, the form keeps processing even though it is closed. I want the form to completely end and exit out of its loop statement, and then open a new form.</p>
  
  <p>Here is the code I am using to close the form</p>
  
  <pre><code>frmMain.Close()
  frmMain.Dispose()
  </code></pre>
  
  <p>Note: I am not using threads it's just a simple <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="noreferrer">VB.NET</a> application. I am not closing the main startup form.</p>