Winapp not to run twice

Scanzee

Member
Joined
May 26, 2007
Messages
23
Programming Experience
1-3
How can I make sure, the application does not run twice...
If users try to open the application a second time, It shows a messagebox or something...

Thanks
Scanzee Productions
 
The usual behaviour would to just activate the existing main form, which you'd do in the StartupNextInstance event handler like so:
VB.NET:
With Me.ApplicationContext.MainForm
    .Show()
    .Activate()
End With
 
That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state.
 
That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state.
Even better. :)
 
Back
Top