i made an application and i dont want to able openning the application again while it is running, how shel i do it
thanks for all
Printable View
i made an application and i dont want to able openning the application again while it is running, how shel i do it
thanks for all
Look up this app.PrevInstance
Beni,
' Check If there is already Running instance.
If App.PrevInstance Then
MsgBox "Application Already Running"
Unload Me
End
else
MsgBox "Do your..."
End If
Most likely, you should put the code in Sub main() in a bas file or at the very top of Form_Load or even Form_Activate.
If you want to keep only one instance and if another is loaded, give it focus, like vb 3.0 does: Have only one instance and give the current one focus.