title: Close Main Form
body: <p>I am developing a simple app using c# Windows forms. The main form open another form, but i dont want the both forms. I want it that when the second form opens the first form closes. Since the first form is the main using</p>
  
  <pre><code>    this.Close();
  </code></pre>
  
  <p>after showing the second form will close the both. So i used this instead</p>
  
  <pre><code>    private void btnSubmit_Click(object sender, EventArgs e)
      {
           frmData QS = new frmData();
           QS.Show();
           this.WindowState = FormWindowState.Minimized;
           this.ShowInTaskbar = false;
      }
  
      private void frmData_FormClosed(object sender, FormClosedEventArgs e)
      {
          Application.Exit();
      }
  </code></pre>
  
  <p>I want to know if there is any other way to do this.</p>
  
  <p>Any help will be appreciated.</p>