This is part of the 'application framework' (project properies > Application tab), and involves generated code. Have a look with .Net Reflector at a basic project you have compiled with VS. In your My namespace you will find a generated MyApplication class that derives from WindowsFormsApplicationBase, in constructor it sets ShutDownStyle property among other things. Notice in Main it starts the application through Run method of this class. Also notice in OnCreateMainForm it sets MainForm property. Overview of the Visual Basic Application Model
As usual when vbc questions come up, I recommend you instead write/generate the same project files as VS does and use Msbuild to compile the project, much simpler.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.