Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent user to open form second time
Message
 
 
À
26/01/2005 10:18:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Novell 4.x
Database:
Visual FoxPro
Divers
Thread ID:
00980766
Message ID:
00980782
Vues:
43
Hi, Saif.

>Is there any way to prevent users to open an already open form twice.
>I made command button disable after open a form. But when the form release this command button does not enable.

You can check in the form's Init whether there is another instance of the same form open, like:
llAlreadyExists = .f.
for each loForm in _Screen.Forms
   if loForm.Caption = this.Caption
      llAlreadyExists = .t.
      exit
   endif
next

return NOT llAlreadyExists
Notice that I'm using the Form's caption to check for the equivalence, but you can use some other property where we have some unique identification if you need it.

Hope this helps,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform