Results 1 to 4 of 4

Thread: Starting form from Sub Main

Threaded View

  1. #1

    Thread Starter
    Junior Member El-Phantasmo's Avatar
    Join Date
    Sep 2002
    Posts
    30

    Starting form from Sub Main

    Ok I have an app and I want to be able to execute from command line and from GUI.

    I created a sub main

    Code:
      Public Shared Sub main()
    
        Dim args As String() = Environment.GetCommandLineArgs()
        Dim arg As String
    
        If args.GetUpperBound(0) = 0 Then
          ' load user interaction form
          Dim f As New frmNetStat()
          f.FormLoad()
    
        Else
          frmNetStat.GetCommandLineArgs()
    
          ' process arguments
          ' no visual display is necessary
        End If
    
      End Sub
    
      Public Sub FormLoad()
        lblStatus.Text = "Awaiting command..."
        g_strConnection = "connection info..."
    ' form shows up and then exits immediately
        Me.Show() 
      End Sub
    however, the problem is it pops up the form and disappears w/o any type of input from the user

    My sub main procedure is placed just below the
    Public Sub New proc...
    public sub form load is in the main part of the code
    I did change the startup to be Sub Main and not the standard formload.

    Any ideas
    Last edited by El-Phantasmo; Sep 3rd, 2002 at 06:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width