
trying to start a form, from a MAIN sub in a module
Hi,
I use VB net.
I just try to start a form that i've created with VB gui :
Public Class frmPacketeer
Inherits System.Windows.Forms.Form
When I use "start up object" equal to frmPacketeer eall working fine. My
FORM start and I use my PGM.
What I want to do is have the same program work in command line mode or in
windows form mode.
So I add a MAIN SUB, in a new module called MAIN:
Module Main
Public Const
In the main sub, I check if args are pass.
If i have no args then ALL is executed without any forms.
If i get ARGS, then I when to start the form : frmPacketeer
If i Here my main sub :
Sub main()
Dim args() As String
Dim myForm As New frmPacketeer()
args = GetCommandLineArgs()
If Trim(LCase(args(0))) = "start" Then
myForm.Show()
Else
MyDate = Today
genHTML(CInt(MyDate.Year), CInt(MyDate.Month))
End If
End Sub
What happen is, when I pass arg "START" to my program, then he show the form
really fast then the form disapear and the program stop. Why my form is not
show so i can use it?