Application Level Events

T

thechaosengine

Hi Everyone,

In asp.net you have the Global.asax file that allows you to handle and exceptions
that have slipped through the net in your code. It also allows you to handle
application level events in a central place.

Is there a similar mechanism for dealing with global events and exceptions
in Windows Forms applications?

If not, what would be the best approach to make sure that any erstwhile unhandled
exceptions are caught and dealt with graciously?

Thanks to anyone who can help

Kind regards

tce
 
R

Rodger Constandse

Hi,

The System.Windows.Forms.Application class provides an event called
ThreadException that occurs when an untrapped thread exception is thrown.

I use this event to trap unhandled exceptions in my application and display a
message to the user.
 

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