How to make a single instance application in Visual Basic 2008, VB 2010, and VB 2013

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
 

Microsoft actually added an application Pre-Instance feature in version 2005 of VB. It is also available in VB.NET 2008 and Visual Basic 2010. You no longer have to use code to do so like you did in the original versions of .NET.


You can enable it like below…

Go to the Project menu, click Properties, click the Application tab and below the: Windows Application Framework Properties groupbox you will see a checkbox named: Make Single Instance Application. You simply checkmark that box and it will not allow your application to contain more than 1 loaded instance at a time.

singleInstance2005


Well that’s it. When your application loads and it detects a clone, it will continue to open your application and close the previous instance. Have fun!

Jason

Revised: 2015

Leave a Reply

Your email address will not be published.