How to handle unhandled exceptions in Windows Forms
This event is simple to use, but cannot be used to handle exceptions thrown in threads other than the main thread.
If you are working with multiple threads, you can take a look at this short article that shows how to handle unhandled exceptions for multithreaded Windows Forms applications.