Hi group,

I already build a program with vb6. The problem is when the program is running and user click the exe file again then it makes program running twice in same time.
Is there a way to restrict this happened?

Thank you.

Recommended Answers

I already build a program with vb6. The problem is when the program is running and user click the exe file again then it makes program running twice in same time.
Is there a way to restrict this happened?

Something like this should working :

Private Sub Form_Load() …
Jump to Post

All 3 Replies

Re: Restrict my vb program to running twice or more in same time 80 80

I already build a program with vb6. The problem is when the program is running and user click the exe file again then it makes program running twice in same time.
Is there a way to restrict this happened?

Something like this should working :

Private Sub Form_Load()
    If App.PrevInstance = True Then
        MsgBox "Application is running!", vbExclamation, "Warning"
        End
    End If
End Sub
commented: Very simple code but worked great!! +3
Re: Restrict my vb program to running twice or more in same time 80 80

Wow..
I don't that it just a very simple code.
Thank you for quick help sir

Re: Restrict my vb program to running twice or more in same time 80 80

You're welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.