R
RSH
Hi,
I have a silly question...
I have a Windows Form project (VB.Net) that was created in Visual Studio
2003. The project runs great.
Now I have to add the ability to run the same application from a
commandline. The obvious issue is going to be with all of the form specific
settings...luckily I wrote the app using classes to seperate the form
specific logic from the business logic.
The issue i have however, is that if I change the Startup object in the
project properties from "Form1" to "SubMain" and then check for commandline
arguments if none exist then I'm instantiating the Form object as follows:
Public Class Form1
Inherits System.Windows.Forms.Form
Public Shared Sub main(ByVal CmdArgs() As String)
if CmdArgs.length > 0 then
Dim frm As New Form1
frm.ShowDialog()
else
RunCmdApp()
end if
End Sub
end class
This all seems to work fine from the Commandline, BUT now when there are no
commandline arguments a simple blank form shows (not my form which has all
sorts of controls and such). The class name is Form1 but the filename is
frmMain.vb but that doesnt seem to have anything to do with it.
What am I missing? I want my form back.
Thanks,
Ron
I have a silly question...
I have a Windows Form project (VB.Net) that was created in Visual Studio
2003. The project runs great.
Now I have to add the ability to run the same application from a
commandline. The obvious issue is going to be with all of the form specific
settings...luckily I wrote the app using classes to seperate the form
specific logic from the business logic.
The issue i have however, is that if I change the Startup object in the
project properties from "Form1" to "SubMain" and then check for commandline
arguments if none exist then I'm instantiating the Form object as follows:
Public Class Form1
Inherits System.Windows.Forms.Form
Public Shared Sub main(ByVal CmdArgs() As String)
if CmdArgs.length > 0 then
Dim frm As New Form1
frm.ShowDialog()
else
RunCmdApp()
end if
End Sub
end class
This all seems to work fine from the Commandline, BUT now when there are no
commandline arguments a simple blank form shows (not my form which has all
sorts of controls and such). The class name is Form1 but the filename is
frmMain.vb but that doesnt seem to have anything to do with it.
What am I missing? I want my form back.
Thanks,
Ron