BlackStone Posted June 14, 2004 Posted June 14, 2004 I am a VB6 programmer who is trying to make the move to VB .NET. I have a question. In VB6, you could have a start your app from Sub Main() and then launch a form, or an instance of it. Sub Main() Dim frm as Form1 frm = New Form1 Load frm: frm.Show End Sub This would automatically start the form when the app starts. In VB.NET, I am doing a similar thing: Module Startup Sub Main() Dim frm as New Form1 frm.show() End Sub End Module I would think that the form would stay open even when the program leaves Main(), but it doesn't. The only way I could keep it open was to use .ShowDialog. How can I do the .NET equivilent of my VB6 Sub Main()?? Quote "For every complex problem, there is a solution that is simple, neat, and wrong." - H. L. Mencken
Administrators PlausiblyDamp Posted June 14, 2004 Administrators Posted June 14, 2004 Sub Main() Dim f As New Form1 f.Show() Application.Run(f) End Sub Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jjoseph Posted July 2, 2004 Posted July 2, 2004 Set The Entry Point For The Project If you open the Solution Explorer in VB.NET, then right mouse click upon the Project Name, and select properties. From the Project Properties window select the Startup Object pulldown menu and then select the form use wish to execute when the Project starts, this does away with writing code to start the form and the form will remain open. Hope this helps. Jon. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.