Can you start a vb.net app without a form?

C

COHENMARVIN

In vb6 you could start a program from a 'main' routine that was in a
module. But I don't see modules in vb.net. There just seem to be
forms and classes. Is there any way to start the program so that you
aren't showing a form immediately?
Thanks,
Marv
 
K

kimiraikkonen

In vb6 you could start a program from a 'main' routine that was in a
module. But I don't see modules in vb.net. There just seem to be
forms and classes. Is there any way to start the program so that you
aren't showing a form immediately?
Thanks,
Marv

Just start a console application project, and your module is ready
with Sub Main().

Thanks,

Onur Güzel
 
C

Cor Ligthert[MVP]

Marv,

To give you the oldest VB.Net version.

Right click on the project and do add new item and choose module

\\\
Module Module1
Private frm As Form1
Public Sub Main()
Application.Run()
frm.Show()
End Sub
End Module
///

Then we have something different per version, in version 2008 it is

Choose the properties from the applications and change the form project to a
console project and the "startup box" to Sub Main

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top