views:

113

answers:

2

Trying to get it to behave like C#, where there is a Program class with a static Main method.

However, in the project properties, I cannot set Program.vb to be the startup object, only the forms (it is a forms application).

Am I missing something?

I am using the VS2010 and the latest VB.

A: 

You need to switch off “Application Framework” on the main page of the project settings.

The application framework provides its own entry point which sets up a few things that are subsequently used (e.g. application events, single instance checks etc.) and then just displays the main form using System.Windows.Forms.Application.Run. That’s why you can only supply the main form, not a custom entry point method.

Konrad Rudolph
+2  A: 

Uncheck Enable Application Framework in Project Properties.

SLaks