*RESOLVED* Load a form from main class
I've just started with VB.NET after years of experience in VB 6.0 and I have a little problem.
I've created a class with a sub main. This routine creates a new form which it does just fine, but after that statement it returns immediatly. In VB 6 it would return if the form was closed. The main difference is that I'm expecting the form to take over control, waiting for events and stuff. Because the call just returns my program finishes closing the window.
VB Code:
Public Class Bomberman
Private Shared frmMain As Main
Public Shared Sub Main()
frmMain = New Main() 'VB 6 would return at the moment the form was closed, VB.NET returns immediatly!
frmMain.Show()
End Sub 'because it will return, my app finishes immediatly.
End Class
I found out by creating a new project with a 'startup form' the form would normally load without exiting immediatly. I wanted to know how it did that so I had a look at it's code. I noticed that there was not a single byte different from my forms code. The difference between the projects is that I have a seperate class with a sub main, creating the form, and the other project starts the form by default. How can I find out how to make my form stay without calling it by default?