where is sub main() in Visual studio generated code?

gmukwewa

New member
Joined
Jun 7, 2005
Messages
2
Programming Experience
Beginner
I am a newbie in VB.Net, where do i find the entry point (sub main()) in the code generated by Visual studio.net for my single form App. Please help!!
 
For a single App form, the Sub Main procedure is created for you in the background by the compiler (this is done because VB is intended to be used for Rapid Application Development). If your single form were named Form1, a procedure similar to the following would be created and executed:
VB.NET:
<STAThread()> Public Sub Main()
    Dim frm As New Form1()
    frm.show()
End Sub
You can however create your own entry point (in some Module or Class file) and use it as the Startup Object (in the Property pages, set the StartUp Object to 'Sub Main' in the dropDown provided under Common Properties > General).
 
Back
Top