title: Window close events in a winforms application
body: <p>I am looking to prompt the user to save data when they close a form window in a winforms application. I can't figure out how to trigger the prompt to the user, should they click the red box at the top right corner of the form. </p>
  
  <p>My application currently has a boolean flag, that is set to True on textchanged event. So I will only need to check for the boolean value in whatever event is trigger by the red box.  </p>
  
  <p>Any advice?</p>