Hi,
What's the best way to prevent opening of two instances (or more) of the application?
Thanks
Printable View
Hi,
What's the best way to prevent opening of two instances (or more) of the application?
Thanks
Check the single-instance box in the project property pages.
Thanks. Where is it exactly? I can't find it...
Is this a Windows Forms Application project, as I am assuming? If so the box is there in the project properties and if you look you'll find it. If it's not a WinForms app then there is no such box and you'd have to handle it manually.
OK, I see that I have to enable application framework and then I can set the single instance.
What is the affect of "enable application framework"?
You can see that I'm a newbie in VB.NET. I'm coming from VB6 and C++
The application framework should be enabled by default for new projects. Was your project upgraded from VB6 or VB.NET 2002/2003? If not then you must have disabled the application framework explicitly.
The application framework exists to do things like this. It will manage single-instance apps, splash screens, etc. for you so you don't have to write fiddly code to perform common application-based tasks. With the framework enabled the Main method is hidden from you and you handle application-level events, e.g. Startup and Shutdown, to do things that you would otherwise have done in the Main method.
OK, I see that I have to enable application framework and then I can set the single instance.
What is the affect of "enable application framework"?
You can see that I'm a newbie in VB.NET. I'm coming from VB6 and C++