title: Close VB.Net application from Startup event
body: <p>I am writing a vb.net application and am trying to close the application gracefully from the startup event if there are certain errors. </p>
  
  <p>Is there a way to do this?</p>
  
  <p>At the moment I have the "Enable Application Framework" checkbox selected, and all code is in the "Private Sub MyApplication_Startup(sender As Object, e As ApplicationServices.StartupEventArgs) Handles Me.Startup" event</p>