How do I control shutdown style with vbc.exe?

System_Code

Member
Joined
Jul 29, 2008
Messages
8
Programming Experience
1-3
How do I control the ShutDownStyle property of Windows Forms Applications created with vbc.exe?
 
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. :)
 
Back
Top