Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // handle UI thread exceptions
  2. Application.ThreadException += Application_ThreadException;
  3.  
  4. // handle non-UI thread exceptions
  5. AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
  6.  
  7. Application.EnableVisualStyles();
  8. Application.SetCompatibleTextRenderingDefault(false);
  9.  
  10. // force all windows forms errors to go through our handler
  11. Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement