you can set Sub Main as your start up , then do this ...
Visual Basic:
'/// add a module to your application , then set it's Sub Main as your start-up object
Imports System.Windows.Forms
Module Module1
Sub main()
Dim frmMain As New Form1
frmMain.Show()
Application.Run() '/// NOTE : i run the application without a start-up Main form.
End Sub
End Module
if you close the Form1 ( or any other Form ) the application will still be running , so make sure you handle this with some sort of boolean switch
eg:
Visual Basic:
Dim closeapp As Boolean
'/// in an unload function ( somewhere in your Application that can be accessed publicly )
If closeapp = True Then
Application.Exit()
Else
'/// do nothing
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.