Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect single instance of a form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00418053
Message ID:
00418066
Vues:
32
>What is an fancy way, to detect in my form init that this form does not already run?
>So i want to be sure of a single instance of my form.
>
>Thanks in advance,
>
>Bjorn

Bjorn, in general you need to loop through the _screen.forms collection and see if the form with the same form.caption already exists. Then you decide what to do - for example you may actvate that form. Many frameworks have the Form Manager object which takes care of all running forms (and has it's own array of running forms). There may be variations with checking - you may check for .caption, .name or SCX name of running form. It depends on the needs of your application if multiple instances of the same form are allowed. The form may have the property .lAllowMultiInstance and the Form Manager will check it before running. When you allow and run another copy of the form you may add something to its caption to distinguish them - like "My Form Caption -[2]"
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform