Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing to open a form twice or more ...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00411292
Message ID:
00411313
Vues:
15
>Any great idea how would i prevent to open a form more than once...

Noel, you may have the code similar to this:

oApp.RunForm(tcFormName)

*** oApp.RunForm method ***
PARAMETER tcFormName
FOR n = 1 to _screen.FormCount
IF _screen.Forms[n].BaseClass == "Form"
IF _screen.Forms[n].cSCXName == tcFormName+".SCX"
IF !_screen.Forms[n].lMultiInstance
ACTIVATE WINDOW (_screen.Forms[n].Name)
ELSE
DO FORM (tcFormName)
ENDIF
ENDIF
ENDIF
NEXT


This code supposes you have .cSCXName property in your base form class and during form initialization you store there the form's SCX name obtained with SYS(1271)
You also may check if multiinstance is allowed for the particular form, storing the proper value in form.lMultiInstance property.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform