title: Capturing Error Events
body: <p>I was creating some complex applications in Visual Basic .NET 2008 and since they are in the testing phase right now, people manage to find an error or two every so often that causes the program to crash.  The problem is that there is a tracking piece to it that logs who is currently using the programs.  When a user logs in, it logs that they are currently logged in, and if the form close event is fired, the log is deleted to show that they have closed it.  </p>
  
  <p>Now my problem comes whenever the form crashes from an error since it won't trigger the close event and therefore makes the log become inaccurate.  My question is if it is possible to capture any error that the form would have in the form of an event?  </p>