Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prevent opening a form if it's already opened.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00557131
Message ID:
00557264
Vues:
12
>I know there has to be a standard way to do this. Within my app I launch forms from menus, from command buttons within other forms, and by double-clicking areas of forms, all using the DO FORM command. I am using the following code in the LOAD event of some of my forms to prevent creating a new instance of the form if it already exists:
>
>IF TYPE("Reportselect") = "O" and !ISNULL(Reportselect)
> Reportselect.Show()
> RETURN .F.
>ENDIF
>
>Of course "Reportselect" is the name of this particular form. How can I use a generic version of this code in the base class for my forms.
>
>
>Thank you kindly for your help.

You can also try WVisible() or WExist() for this:
If WVisible('frmparts')
  Activate Window frmparts
  Keyboard '{CTRL+F5}'  &&Restore if minimized
Else
  Do Form parts
Endif
Where frmparts is the form's name as specified in the Name property.
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform