First Question:
Yes you can do that. You would need to use the sub main procedure. The sub main is usually used for things like a splash screen, but you could use it to start two seperate threads.
Second Question:
You would need to import file IO, but yes you can delete a file or files.
Chester
cpopham
Junior Poster in Training
65 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
Can you describe the "sub-main procedure" to me? Sorry, I'm a noob.
Right Click on your project and the click Add New Item
Click Module
Name your Module
Open the new Module
Between the Module Header and Footer, type Sub Main() and enter
Now enter your code.
On the Solution Explorer right click and click on your settings, under startup, click Sub Main.
Hope this helps.
Chester
cpopham
Junior Poster in Training
65 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
Thanks, but one more thing..."Now enter your code" which code is that? Like the code that opens both of them or what? Thanks.
Yes, it would be the code to launch each program. I actually think what he was trying to do is to have your project load two forms, instead of two exe's. You could just as easily have 1 of your exe's launch your other EXE on form load.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Since you are in VB.Net The System.Diagnostics namespace exposes a Process class:
Dim myProcess As Process = System.Diagnostics.Process.Start("c:\somepath\somefile.exe")
obviously, you will need to change "c:\somepath\somefile.exe" to the path of the program that you want to launch (in this case, your other program). That should effectively launch the exe. Now, just stick that in your form load... and whenever EXE 1 runs, it will launch EXE2 by default.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
There are more ways than one to accomplish what you want....
Chester
cpopham
Junior Poster in Training
65 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
There should be a timer control (looks like a stop watch, I think). Set it's interval to 1000 (which is 1 second (1000 milliseconds)). Now, every second this timer event will fire. In Your declaration section of the form (where you declare form wide variables) add a public variable to keep track of the time, call it: timevariable. In The Form Load Event of your form, set the variable to the max amount of time (the number you want to start at). Then, in the timer event (every second), add this:
if timevariable = 0 then
msgbox "game over"
exit sub
end if
timevariable = timevariable - 1
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215