Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_SCREEN.ActiveForm Bug / Inconsistency
Message
From
22/01/1999 19:48:10
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00178859
Message ID:
00179304
Views:
23
Hi George,

Yes, I have noticed this. When focus is on the main VFP window, _SCREEN is actually referencing itself so this makes sense. However, when a child form is active (on top of a top-level form), _SCREEN.ActiveForm should return the object reference to the top-level form if it recieves focus with the child form(s) still present - this only occurs after the child form(s) are destoyed.

It seems as if VFP confuses the top-level form with _SCREEN in the case where another modeless form is open (and yes, .ShowWindow = 1).

The way I look at it, I have two choices:

[1] Use top-level forms as an application workspace only with no contained controls.

[2] Place code in the .Activate event of my form base class which sets a property in my application object to the active form's reference.

Actually, I have already implimented the second approach. Since my app object maintains it's own forms collection, this addition virtually eliminates any need for my framework to ever use _SCREEN for anything.

The question still remains: Is this a bug?




>Jeff,
>
>This happens with top-level forms, .ActiveForm will sometimes contain the reference sometimes not (depending on what had the focus last). For example, open the Debugger, before starting the top level form then look at _SCREEN.ActiveForm in the Debugger, and you'll probably see the form. Next, click on the main VFP window and go back to the Debugger. You'll probably see, "Expression could not be evaluated". The Forms collection suffers from the same thing.
- Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform