Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Do I Prevent Multiple Instances Of The Same Form
Message
De
20/08/1999 06:08:04
 
 
À
20/08/1999 06:01:00
Ilie Tomac
Eagle Investment Systems LLC
Boston, Massachusetts, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00255528
Message ID:
00255749
Vues:
16
Hi
If you don't wan't to open a form again if it's already open you can also put the following code at the place where you call the form:

if not wexist("_your_form_name_")
do form _your_form_name_
endif

or if it is in a menu you can try this:

define bar 3 of mymenu prompt "something" skip for wexist("_your_form_name_")

/Mårten Törnquist

>Hi, Doug
>Try using _SCREEN object:
>
>LOCAL lFormExists
>lFormExists=.f.
>FOR i=1 to _SCREEN.FormCount
>IF _SCREEN.Forms[i].Name='_Your_Form_Name_'
> _SCREEN.Forms[i].ZOrder(0)
> lFormExists=.t.
> EXIT
>ENDIF
>ENDFOR
>IF ! lFormExists
> DO FORM _Your_Form_Name_
>ENDIF
>
>BTW, instead of "_SCREEN.Forms[i].Name='_Your_Form_Name_'" you
>can use "_SCREEN.Forms[i].Caption='_Your_Form_Caption_'" or any
>other property of form.
>
>All the best.
---( Mårten Törnquist )---
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform