Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with _Screen.ActiveForm.ActiveControl
Message
From
03/05/2001 15:46:14
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00476476
Message ID:
00503212
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform