[.net] Custom exception window for "uncatched" exceptions?
Hi!
Is there a way to globally catch and display all uncatched (unexpected) exceptions, and display them in a custom window instead of the built-in one?
Thanks for the answers! ;)
In a Windows Forms app, you should hook up to the Application.ThreadException event. There's also the AppDomain.UnhandledException event.
Quote:Original post by Arild Fines
In a Windows Forms app, you should hook up to the Application.ThreadException event. There's also the AppDomain.UnhandledException event.
thanks! and how can i disable the built-in exception message window?
Quote:Original post by orbanoQuote:Original post by Arild Fines
In a Windows Forms app, you should hook up to the Application.ThreadException event. There's also the AppDomain.UnhandledException event.
thanks! and how can i disable the built-in exception message window?
wrapping Main in a try-catch block with Exception e should do it. There's probably a better way tough.
Just be careful not to crash in your exception handler, or you could lose the original exception information.
I once had this happen, because I was accidentally disposing the windows forms default font.
I once had this happen, because I was accidentally disposing the windows forms default font.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement