Application terminated when Sub Main finishes

  • Thread starter Thread starter schapopa
  • Start date Start date
S

schapopa

I am working on upgrading my application from VB 6.0 to .net and I have
module set as a startup. There is a warning that application will
terminate when Sub Main finishes and recommendation to move code to Load
event, but in module there is no such event. (I am not intending to
terminate application at this point)

For me I cannot understant why after executing

frmMain.DefInstance.Show()

which is last command in my Sub Main, application terminates on (Exit
Sub)

Thank you
Schapopa
 
Module Main
Sub Main( )
dim frm as new YourForm
Application.Run(frm)
End Sub
End Module

hth Peter
 
Thank you Peter,

Something happened, my application is not terminating now. There are a
lot of other issues, so I cannot figure if that is the way I want.
 
Do you really need the module as a startup now. Do like the warning is
telling you & move your code to the Form_Load event, change form to startup
& delete the module. It depends on what code needs to be run in the module,
but my guess is the module isn't required

Crouchie1998
BA (HONS) MCP MCSE
 

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

Back
Top