|
-
Jul 12th, 2007, 03:11 AM
#1
Thread Starter
Addicted Member
[2005] One Instance
How would I only allow one instance of the application running at one time on a computer??
Thanks!
-
Jul 12th, 2007, 03:26 AM
#2
Re: [2005] One Instance
Go to the Application tab of the project properties and tick the appropriate box.
-
Jul 12th, 2007, 03:32 AM
#3
Hyperactive Member
Re: [2005] One Instance
I know the method mentioned above is better;
(If this even works) will declaring a form "Shared" prevent multiple instances, or just force changes made on one to occur on the other aswell?
-
Jul 12th, 2007, 03:42 AM
#4
Re: [2005] One Instance
The 'Shared' key word has nothing to do with single instances, plus you cannot declare a class Shared in VB.NET. The C# equivalent of 'Shared' is 'static' and you can declare a class static in C#, but the VB.NET equivalent of a static class is a module.
The 'Shared' key word is applied to members to indicate that they are members of the class itself rather than any particular instance. It's not correct to say that Shared members affect all instances of a class. It's correct to say that Shared members affect no instances of the class. They affect the class itself.
-
Jul 12th, 2007, 03:46 AM
#5
Hyperactive Member
Re: [2005] One Instance
ahh, got it...
So that wouldnt work...
And so rather than declaring a class shared, you would declare an instace of it shared, which is what I knew but just needed to clarify, and thanks for mentioning the C# thing, I often wrapped my head around that when trying to convert code and never got it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|