showdialog throws exception when closes

G

Guest

Dim f As New frmWeb
f.ShowDialog(Me)
f.Dispose()
Annytime i call a diffrent form from my main form using showdialog, i get an
exception eror thrown when i close the form, but when i use f.show i don't
get any errors, i need the knew form to keep the focus until closed.

thank you
 
J

Jon Skeet [C# MVP]

GATMAN said:
Dim f As New frmWeb
f.ShowDialog(Me)
f.Dispose()
Annytime i call a diffrent form from my main form using showdialog, i get an
exception eror thrown when i close the form, but when i use f.show i don't
get any errors, i need the knew form to keep the focus until closed.

What's the exception?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
G

Guest

Anytime i use form.showdialog() instead of form.show() the following error
occurs,

An unhandled exception of type 'System.Runtime.InteropServices.SEHException'
occurred in system.windows.forms.dll

Additional information: External component has thrown an exception.

Then if i click the break button, "frmNetForm" is highlighted in the
debugger with the green arrow in the left column in the begining of my class,

Public Class frmNetForm
Inherits System.Windows.Forms.Form

The error always occurs when i close the form i called, it happens when i
call any of the other foms in the project using .showdialog.
 
J

Jon Skeet [C# MVP]

GATMAN said:
Anytime i use form.showdialog() instead of form.show() the following error
occurs,

An unhandled exception of type 'System.Runtime.InteropServices.SEHException'
occurred in system.windows.forms.dll

Additional information: External component has thrown an exception.

Then if i click the break button, "frmNetForm" is highlighted in the
debugger with the green arrow in the left column in the begining of my class,

Public Class frmNetForm
Inherits System.Windows.Forms.Form

The error always occurs when i close the form i called, it happens when i
call any of the other foms in the project using .showdialog.

As I said before, please give a short but complete program which
demonstrates the problem.
 

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