how to show a form or process command line args

G

Guest

Hello. I would like to write a console application and windows form
application all in one. If there are command line arguments, then I would
treat it as a console app. Otherwise, I would display a form. I'm having
trouble doing this. Any ideas??

Here's what I did so far:
1) Create a new console application
2) In the Main, i use this code, but it only briefly displays the form, then
it goes away. The code looks like this:

Sub Main(ByVal args() As String)
If args.Length = 0 Then
Dim frm As New frmMain
frm.Show()
frm.Focus()
Else
'....
End If
End Sub

Thank you in advance for your response!

Steve
 
J

Jon Shemitz

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

Top