title: Asking for confirmation when "X" button is clicked
body: <p>The problem is that the messagebox with "sure you wanna close?" does pop up, but when I click "no", it still proceeds to close the program. Any suggestions?
  Here's my code:</p>
  
  <pre><code>    protected override void OnFormClosing(FormClosingEventArgs e)
      {
          CloseCancel();
      }
  
      public static void CloseCancel()
      {
          const string message = "Are you sure that you would like to cancel the installer?";
          const string caption = "Cancel Installer";
          var result = MessageBox.Show(message, caption,
                                       MessageBoxButtons.YesNo,
                                       MessageBoxIcon.Question);
  
          if (result == DialogResult.Yes)
              Environment.Exit(0);
      }
  </code></pre>