Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with _Screen.ActiveForm.ActiveControl
Message
De
03/05/2001 15:46:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476476
Message ID:
00503212
Vues:
25
>FYI.
>
>You can create a method of your application object (or forms manager) that returns the real ActiveForm and use this method call instead of the _Screen property. Ex.
>if vartype(_Screen.ActiveForm) = "O" ;
>   and pemstatus(_Screen.ActiveForm,"BaseClass",5) ;
>   and upper(_Screen.ActiveForm.BaseClass) = "FORM" then
>   return _Screen.ActiveForm
>else
>   * use a Do While Loop to cycle through the .Parent properties until you get to an object that's a form
>   local lotmp
>   lotmp = _Screen.ActiveForm.Parent
>   do while .T.
>      if isnull(lotmp);
>         or upper(lotmp.BaseClass) = "FORM" then
>         exit
>      else
>         lotmp = iif(vartype(lotmp.Parent) = "O",lotmp.Parent,NULL)
>      endif
>   enddo
>
>   return lotmp
>endif
>Haven't tested this, so YMMV. It may have to be tweaked to add more error trapping.


Thanks, Larry. Always good to know there's a work-around in case I ever run into this situation (so far so good).
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform