Hello,

This feels like a stupid question that I'm asking, but regardless it's been a giant thorn in my side...so...

In the process of converting a Vb6 app to VB.Net (not using the wizard, since it's a bit too complicated for the wizard), I ran into the problem of replacing VB6's method for loading and showing a form:

Set variable_for_form = New form_name_here
Load variable_for_form


Now, with VB.Net, the clearest method I can think of as a replacement is as follows:

Dim variable_for_form = New form_name_here
variable_for_form.Show()


-----

Before I go on, I must add that the app is set to start by using a module called "modmain.vb", that holds basically all of the procedures that get used multiple times in the application. Modmain.vb has the procedure "Sub Main()", which is where the application looks to first when it is run. Thus, my code for showing my first form (form_name_here in the code above), is in Sub Main() in modmain.vb.

The code is literally as follows:

Sub Main()

Dim fForm = New frmSplash
fForm.Show()

End Sub


With frmSplash being the first form my app needs to display.


Continuing...if I use "variable_for_form.Show()", the application will start, and promptly quit. The form does load, because I can see it doing such, but as soon as it is displayed it will close and the application will close with it.

If I use "variable_for_form.ShowDialog()", the form displays just fine, with the exception that any code in the "Form_Load()" procedure for that particular form, is not run. And, it kind of needs to be...

Basically my main question is:

"How to I load and display a regular, basic, no frills, plain 'ol form in a VB.Net Windows Application?"

-----

Undoubtedly there is the simplest of solutions to this problem, and I'm terribly sorry for having wasted your time. If that's the case...just smack me over the back of the head and give me the right code so I'll be on my way, thanks.

Your replies are much appreciated,
Daniel Gow.