Application.Run() and ShowDialog error

M

Mike Walters

I have a Appication starting thought a Module Main sub
<System.STAThread()> _
Public Sub Main()
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.Run(splash)

End Sub

This works great, I start my splash screen and move on from there, now
from my main form I have a about menu option. I want the about frm to
be a model form so I use
Dim frmAbout as new About
frmAbout.ShowDialog()

This works also. but…

When I close frmAbout I get a error



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

Additional information: External component has thrown an exception.


Thanks all
Mike
 
P

Peter Huang

Hi Mike,

I am somewhat confusion about your senario,
1. Is the splash in your code a winform? If so, when do you instantiate the
splash?
2. How do you move on from the splash to the Main Form? i.e. how do you
instantiate and run the MainForm

Can you post the code about the question above?

Just a guess, it seems that you will run the MainForm from the splash, and
the splash form will exit, am I right?
If so, I think you may try to call the Application.Run( new MainForm()) and
display the splash form before the MainForm has been loaded.(e.g. in the
Form_Load event)


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang

Hi Mike,

I am writing the post to confirm that if you have tried my suggestion.
If you still have any concern on this issue, please feel free to post here.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mike Walters

Thank you, I will give that a try. If I get the same error I will post
more of the code.

Again thanks
Mike
 
P

Peter Huang

Hi Mike,

How is the things going?
Do you have any concern on this issue?
If so, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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