External component has thrown an exception. Error when a form closes

A

AussieRules

Hi,

I have a form(shown as a showdialog), and when it unloads, I get the
following. There is no code in the unload event.

What would be the cause ?

External component has thrown an exception
 
F

Frank M.

Possibly the exception is thrown not through the
unloading of the form itself but due to some part of the
code in your form which call some other component.

To track down where the problem is, I suggest that you
put a breakpoint early in your code (e.g. in the load of
the form). Then step through the code and do whatever
action that you did before to cause the exception (your
dialog form must perform some action). When you find the
offending statement or call, it will perhaps be evident
what is wrong. If not, enclose the statement or section
of code in an error trapping structure:

Try
...
... ' statements that cause the error
...
Catch ex as Exception
MessageBox.Show(ex.Message)

End Try

This will give a more specific message of what is wrong
in the external component that your code is using.


Regards,

Frank M.
 

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