starting an application on timer

  • Thread starter Thread starter jdrott1
  • Start date Start date
J

jdrott1

i'm trying to run an application2 automatically 60 secs after
application1 starts. application1 would have the code to start
application2.

Load_Event for application1

Try
System.Diagnostics.Process.Start("c:\application2.exe")
Catch ex As Exception
MsgBox("Error: " & ex.Message)
End Try

how would i tie a timer function in to this so it could count down
from 60 to 0 and start my application?
 
i'm trying to run an application2 automatically 60 secs after
application1 starts.  application1 would have the code to start
application2.

Load_Event for application1

Try
            System.Diagnostics.Process.Start("c:\application2.exe")
        Catch ex As Exception
            MsgBox("Error: " & ex.Message)
        End Try

how would i tie a timer function in to this so it could count down
from 60 to 0 and start my application?

Hi,
First place the timer on application1 which is your project's
application and set timer to "enabled" and set interval to "60000"
miliseconds = 60 seconds.

Then put the following code in timer1's tick event:
(double click on timer to open tick event sub):


Try
System.Diagnostics.Process.Start("c:\application2.exe")

' Put this to avoid your application to be executed more than once
timer1.enabled = False

Catch ex As Exception
MsgBox("Error: " & ex.Message)
End Try


Thanks,

Onur Güzel
 
Jdrott,

Drag a timer on the surface of your application and fill in all properties.

Then use the event of that.

Cor
 
Dont forget in your timer to set 'Timer1.Enabled = False' after the event
fires (within the event), or you will have the event firing over and over
again constantly opening up the new software.

You can make the enabled=false the first line in the event. The rest of the
event will be executed still.

-Unless that is what you want :-)
 
Back
Top