Startup from Module instead from form? (VS2005)

  • Thread starter Thread starter mtczx232
  • Start date Start date
M

mtczx232

I not see on project property way to config my project to start from
module or class instead from Form on Win App?
 
This is likely because you have the application framewoerk enabled. If you
don't need just disable the applciation framework and those options should
be back again...

Patrice
 
why microsoft drive me to yield one feature!? I need "application
framework enabled" and use with Module as StartUp???
 
My guess is that they need to know what is the main form for the
application.

You could perhaps have a look at the code created for you by VS.NET to repro
yourself all or part of its features (if I remember they hook up some events
and doing some calls into the .NET framework) while still starting a
module...( or perhaps use a "dummy" hidden window).

---
Patrice


<[email protected]> a écrit dans le message de (e-mail address removed)...
why microsoft drive me to yield one feature!? I need "application
framework enabled" and use with Module as StartUp???
 
why microsoft drive me to yield one feature!? I need "application
framework enabled" and use with Module as StartUp???

You don't need to yield anything. Just create a module with a function
called Main (or anything you want to call it). Then in the Project
Application property pane, turn off the "enable application framework"
check box, and select the Main function in the Startup object drop
down. Then, first thing in the Main function do the call:

Application.EnableVisualStyles()

You will probably want to open a main form eventually in Main, and the
best way to do that is to instantiate an instance of the form's class,
and call it with:

Application.Run(FormName)

This is the standard format I use for all VB.NET Windows applications.
 
Back
Top