Global Exception Handling

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
 
M

Michael C

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
 
S

Simon Harvey

Cool - I thought there was something like that.

Many thanks for your help

Kindest Regards

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top