title: Exiting application on MessageBox call in constructor
body: <p>I want to show a dialog (message box) before the actual form, and if user selects no, the application should completly be closed. I am trying to use the code below, but even after clicking on No the form will be shown!</p>
  
  <pre><code>public Form1()
  {
      InitializeComponent();
  
      if (MessageBox.Show("Contiue or not", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1) == DialogResult.No)
          Application.Exit();
  }
  </code></pre>
  
  <p>I also tried <code>this.Clsoe</code> but then I have an exepction on <code>Application.Run()</code></p>
  
  <p>What is the problem? Any idea what would be the best approach for doing so?</p>