S Scanzee Member Joined May 26, 2007 Messages 23 Programming Experience 1-3 Aug 27, 2007 #1 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
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
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,844 Location Norway Programming Experience 10+ Aug 27, 2007 #2 Check the Application property "make single instance", you could display the messagebox in application event StartupNextInstance. How to: Specify Instancing Behavior for an Application Upvote 0 Downvote
Check the Application property "make single instance", you could display the messagebox in application event StartupNextInstance. How to: Specify Instancing Behavior for an Application
jmcilhinney VB.NET Forum Moderator Staff member Joined Aug 17, 2004 Messages 15,135 Location Sydney, Australia Programming Experience 10+ Aug 30, 2007 #3 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 Upvote 0 Downvote
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
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,844 Location Norway Programming Experience 10+ Aug 31, 2007 #4 That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state. Upvote 0 Downvote
That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state.
jmcilhinney VB.NET Forum Moderator Staff member Joined Aug 17, 2004 Messages 15,135 Location Sydney, Australia Programming Experience 10+ Aug 31, 2007 #5 JohnH said: That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state. Click to expand... Even better. Upvote 0 Downvote
JohnH said: That is the default behaviour, you don't need to add that code, the first instance will activate and display even from minimized state. Click to expand... Even better.