Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_Screen.Activeform.Name NOT accurate
Message
De
05/06/2007 17:50:26
 
 
À
05/06/2007 17:22:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01230724
Message ID:
01230758
Vues:
28
>An example would be a prg which determines what to do based on the value of _Screen.activeform.name. Or perhaps a parent class with buttons may determine which buttons to enable based on the value. (Disable the buttons when the form is not active).


>>>Over the years we have consistently used _Screen.ActiveForm.Name to determine the current active form. This has worked until recently. Recently, even though another form will actually be ontop and appear to have focus, _Screen.ActiveForm.Name returns the main form. I can only think that a timer may be running which could shift focus back to the mainform somehow. Is there ever a case when _Screen.ActiveForm.Name may be actually WRONG?

I would think that a custom property attached to _SCREEN or _VFP would be better. Set the custom property value in each form's Activate() event method and clear in the form's Deactivate() method if it is the form's name. You can set this in a base form class and then all your forms would inherit the behavior. You might want to hold an object reference to the form instead of the name.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform