Link to home
Create AccountLog in
Avatar of Freeday
Freeday

asked on

How do I define Main Sub in VB.NET?

Its been awhile since i've done anything in vb.net. When I make a project shouldnt the first form contain a pre made Sub Main? If not how do I define it? WHen I made the project and i view the code for the form there is nothing but regional code.
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

>> shouldnt the first form contain a pre made Sub Main
No, you can define to start in sub main but by default it start on the current form (Form1). You can select the form that start on My Project - Application Tab - Start Up Form
Right click your project, click properties.  Set your start up form to be the one you want.  Then go to the designer view of your form.  Double click the title bar on the form you are creating.  This should go to the code behind for the form's load event.  There are other possibilities for doing this as well.  This just happens to be the most basic way.  Does that help?

ASKER CERTIFIED SOLUTION
Avatar of VBRocks
VBRocks
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.