title: Exit application with Application.Exit without showing GUI
body: <p>Summary:
  When the application is not run with a specified user account the application exits but still creates a GUI. I want it to completely exit</p>
  
  <p>Details:
  I would have thought that the code I have below would work. It checks for a specific attribute of the username, if it doesn't have it, the app closes. Simple. The problem is that the application still creates a GUI even if the user name doesn't contain that attribute. Any ideas?</p>
  
  <p>This code is in my main method. It is a windows form.</p>
  
  <p>Code:</p>
  
  <pre><code>public ProgramMain()
  {
      String runningUser = Environment.UserName;
      if (!runningUser.Contains("asdf"))
      {
          MessageBox.Show("You must run this application with your asdf account.");
          Application.Exit();
      }
      else
      {
          InitializeComponent();
      }
  }
  </code></pre>