Form error equivalent

  • Thread starter Thread starter Alvin Bruney
  • Start date Start date
A

Alvin Bruney

In web forms i can do this
this.Error += some handler?
what is the equivalent for a winform? I'd like to catch unhandled form
exceptions.
 
You can put this in your code (most likely main). This will catch all
unhandled exceptions in your application (unless you create new
AppDomains -- if you don't know if you are or not, then you're not)
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
 
thanks, there seems to be no page or form level equivalent in winforms like
there is in webforms. I'll use what you suggested (or rather pass it on to
lady who asked).
 
Back
Top