Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with _Screen.ActiveForm.ActiveControl
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00476476
Message ID:
00503219
Views:
23
I got word from a user the other day that the textbox control from www.textcontrol.com causes this error. I've never run into it either < knock wood >.

BTW, I CCd Renoir on the message with the code snippet. You just happened to be the primary guy. ;-)

>>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).
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform