Thrown Error NOT Caught!?

G

Guest

Here is the problem.
I'm opening a form that Throw's an error in the Load event and the method
thant opens the form has a try..Catch to Catch the error that is thrown in
the load event.

This works fine running through the design-time enviroment. But if I run
the .EXE it says Unhandled Exception and quits. WHY?

How do I fix this???

Nick
 
H

Herfried K. Wagner [MVP]

chopsnsauce said:
I'm opening a form that Throw's an error in the Load event and the method
thant opens the form has a try..Catch to Catch the error that is thrown
in
the load event.

This works fine running through the design-time enviroment. But if I run
the .EXE it says Unhandled Exception and quits. WHY?

Take a look at 'Application.ThreadException' in the documentation.
 
G

Guest

Well that gives me a work round. But I want the method that opens the form
to catch the exception.

Like I said, when I run my App through the IDE the exceception is caught.
When I run the EXE the exception is unhadles. I want the EXE to catch the
exception as well. Its the same code so why should it behave differently??

Regards,

Nick
 
C

Chris Dunaway

I believe this is the result of a bug. The IDE handles catching the
exception differently somehow. There was a discussion about this in
the last few weeks on this group.
 

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