I've been using the Application_Error event in ASP.NET as a global exception handler for a while. While looking for a way to implement something similar for Windows Forms I found this post: http://blogs.msdn.com/tom_krueger/archive/2005/02/17/375602.aspx explaining how to use Application.ThreadException to do just that.
I then found out that Application.ThreadException is not available in the .net Compact Framework but as explained here: http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html, AppDomain.CurrentDomain.UnhandledException can be used to accomplish the same thing.
There are some problems with using AppDomain.CurrentDomain.UnhandledException as explained here: http://www.codinghorror.com/blog/archives/000201.html