sub Main as Startup

T

tlynch

How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper
way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
 
W

William Ryan

In addition to what Steve said, make sure you specify Sub Main as the start
up object in your Assembly properties dialog.
 
H

Herfried K. Wagner [MVP]

* "tlynch said:
How do I use sub Main as a startup? The following of course exitst
immediately. A loop would just eat up processor cycles. If I use
ShowDialog(), application exits as soon as the second form is launched by
the first form. (Many forms many instances of each form.) What is the proper
way?

main.vb
Module startup
Public Sub Main()
' Initialize Globals
.

Dim mfrmMain As New frmMain
mfrmMain.Show()

Replace the lines above with:

\\\
Application.Run(New frmMain())
///
 

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