title: Switching between Forms in C#
body: <p>When the autogenerated code for my program starts, it calls</p>
  
  <pre><code>Application.Run(new Form1());
  </code></pre>
  
  <p>and starts Form1.  I have another form I'd like to switch to and close Form1 at the same time.  The problem is if I use "this.Close()" in Form1 before I call the other form with "Form.ShowDialog()" then the program ends.  If I put it after ShowDialog then it remains up in the background until I close Form2, at which point the program ends.</p>
  
  <p>How can I spawn a copy of Frame2 while closing the currently opened frame at the same time?</p>
  
  <p>edit:  I have tried calling Frame2 with .Show() as well, but the new frame closes instantly.</p>