Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why is form activate is executing before form load
Message
From
12/11/2002 21:38:12
 
 
To
12/11/2002 20:06:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00721382
Message ID:
00721956
Views:
7
>>>>>Also, any .SetFocus() will activate the form.Just put a breakpoint in the .activate and look up the call stack in the debugger, and you'll catch it.
>>>>
>>>>No SetFocus() at all. But definitely the form.activate is firing before the form.load. What could it be?
>>>
>>>Just put Set Step On in .activate and play Sherlock up the call stack. The only thing that may fire before form.load is something in the DE, so I think you'll find your suspect there.
>>
>>Thanks for your answer. I placed a SET STEP ON in BeforeOpenTables and from there it jumps immediately to form.activate ! No stop anywhere else. I havent found a SetFocus anywhere in the class hierarchy. What could it be ? I am using VFP8, but the same problem occurs with VFP7. Thanks.
>
>That's weird. Seems like behavior induced by an automatic reaction to some property value somewhere... really weird. And hard to track. I've had a few things like that, they're extremely tricky to find, and usually have hard to find, but simple solutions - if that's any comfort.
>
>Anyway, I said to put step on in the activate itself, just to see what's the code which leads there. Also, that would be a good moment to put thisform into the watch window and check if it has any members at the moment. AFAIK, it should have none yet (except the DE), so any object you find may be suspect. Is there any code in DBC events?

Good idea. I found that when form.activate starts up the form already contains a bunch of (still) invisible objects that were defined in a parent class. Those objects are meant to remain invisible until some code later on makes them visible... in some cases. Surely that is where the problem will appear.

I just tried starting the objects as visible, making invisible in form.init those that need to be. First thing I notice is that the controls defined in a lower class are already present when form.activate runs, and before form.load. BTW, form itself is already visible too. That makes sense if something is activating it. But what does?

Another little detail... The form contains an activeX object (Crystal repart 9 viewer). Strong suspect...

Thanks for your help, Dragan.

Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform