Global Exception Handling for winforms control

Alex picture Alex · Aug 5, 2008 · Viewed 15.5k times · Source

When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?

Answer

Chris Leon picture Chris Leon · Aug 5, 2008

You need to handle the System.Windows.Forms.Application.ThreadException event for Windows Forms. This article really helped me: http://bytes.com/forum/thread236199.html.