H
Hugh Janus
OK,
My app opens a form and waits for a user to press a button called "Go".
If I pass the parameter Q at startup I want it to not show the form
but call "Go.PerformClick". So in essence it runs like a console app
writing text out to the DOS window that called it.
The problem I have is that when Sub Main runs, it works out if the
correct parameter has been passed and parses the PerformClick sub but
does not execute it and then carries on with the rest of Sub Main
before ending the app. See code below:
Sub Main(ByVal Args() As String)
If Args.Length > 0 Then
If Args.GetValue(0) = "Q" Then
Console.WriteLine("Fase 3 started: "
&Now.ToShortTimeString)
Dim newF3 As New Phase3
newF3.Hide()
Call newF3.Gop.PerformClick
Console.WriteLine("Fase 3 ended: " &
Now.ToShortTimeString)
Else
Dim newF3 As New Phase3
newF3.ShowDialog()
End If
What am I doing wrong and what do I need to do to force it to wait
until the Sub has finished? I even tried putting it in a thread and
then using .Join but it even jumps this.
Hugh
My app opens a form and waits for a user to press a button called "Go".
If I pass the parameter Q at startup I want it to not show the form
but call "Go.PerformClick". So in essence it runs like a console app
writing text out to the DOS window that called it.
The problem I have is that when Sub Main runs, it works out if the
correct parameter has been passed and parses the PerformClick sub but
does not execute it and then carries on with the rest of Sub Main
before ending the app. See code below:
Sub Main(ByVal Args() As String)
If Args.Length > 0 Then
If Args.GetValue(0) = "Q" Then
Console.WriteLine("Fase 3 started: "
&Now.ToShortTimeString)
Dim newF3 As New Phase3
newF3.Hide()
Call newF3.Gop.PerformClick
Console.WriteLine("Fase 3 ended: " &
Now.ToShortTimeString)
Else
Dim newF3 As New Phase3
newF3.ShowDialog()
End If
What am I doing wrong and what do I need to do to force it to wait
until the Sub has finished? I even tried putting it in a thread and
then using .Join but it even jumps this.
Hugh