471,616 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Application Level Events

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

Jul 21 '05 #1
1 1199
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.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams

thechaosengine wrote:
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

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by thechaosengine | last post: by
1 post views Thread by John Martin | last post: by
1 post views Thread by Steve Teeples | last post: by
4 posts views Thread by David Lozzi | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.