I'm trying to pass a command line parameter to a vb.net solution that starts up with a Windows Form.
I noticed it wouldn't accept parameters, it gave errors when writing the constructors.
So then I created a module, to start up with, that accepts the parameter. And that module then creates the form and passes the parameter to it.
Now my problem is that my form closes immediatly after opening, since my module just shows it and then quits.
Code:Module StartUp Sub Main(ByVal args() As String) Dim frmMain As New frmMain(args(0)) frmMain.Show() End Sub End ModuleWhat am I doing wrong?Code:Public Class frmMain Inherits System.Windows.Forms.Form Public Sub New(ByVal path As String) serverPath = path End Sub .... End Class




Reply With Quote