When you've done that, it should prompt you with a dialog box asking you what type of project you want to make. Choose Standard EXE and press open.

Once you have done that, you should have something that looks like this:
We could now do some sort of design for this form. I will not. I won't because I can't be bothered and you might want to put this in your own project. You can put the code into the Form_Load procedure to make the code work when the application first runs.
Double click on the form. It will come up with some code like this:
Private Sub Form_Load()
End Sub
In the middle of this, insert this code
If App.PrevInstance Then
MsgBox "There is already another instance of this application running. This instance will now end."
Unload Me
End If
You should now have this code
Private Sub cmd_Calculate_Click()
If App.PrevInstance Then
MsgBox "There is already another instance of this application running. This instance will now end."
Unload Me
End If
End Sub
The App.PrevInstance code will return true if another instance of the app is running. So it's saying if the app is already open then display a messagebox; wait for the user to click OK and then Unload Me, which will end the app. Then it ends the If...Then...Else statement.
You should now compile you application by going to the file menu and selecting, "Make Project1.exe" or something similar.
When you've done this, run your app. Then run it again and when you run it the second time a messagebox should pop up with the text you chose.
When you are done with your application, exit out of it and save.
discuss this topic to forum
