sub Main as Startup

  • Thread starter Thread starter tlynch
  • Start date Start date
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
 
In addition to what Steve said, make sure you specify Sub Main as the start
up object in your Assembly properties dialog.
 
* "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())
///
 
Back
Top