Global Exception Handling

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi All,

I'd like to be able to display a nice custom form to the user when any
exceptions occur within my Windows Forms application. In asp.net I would
use the global exception event that yuo can handle in global.asax. Is
there something similar in Windows Forms?

If there isnt something similar, how could I go about catching
exceptions without having to try catch everything I do?

Would a try catch in the Main() method work?

Many thanks

Simon
 
Simon Harvey said:
Hi All,

I'd like to be able to display a nice custom form to the user when any
exceptions occur within my Windows Forms application. In asp.net I would
use the global exception event that yuo can handle in global.asax. Is
there something similar in Windows Forms?

If there isnt something similar, how could I go about catching exceptions
without having to try catch everything I do?

Type Application.ThreadException +=

and follow the intellisence (or push F1)

Michael
 
Cool - I thought there was something like that.

Many thanks for your help

Kindest Regards

Simon
 
Back
Top