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

  • Thread starter Thread starter AussieRules
  • Start date Start date
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
 
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.
 
Back
Top