Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moved event before Init()?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00617898
Message ID:
00618083
Views:
15
>>>>Is it normal for the Moved() event to execute before or after the Init() at form startup, or is one of the property values causing this?
>>>>
>>>
>>>I dont know if its normal, but why dont you put your code to save the position in the destroy or unload event? This will occur only one time when the form will be released and not at each move of the form (including the one in the init)...
>>>
>>>Just my 2c :-)
>>
>>Thanks Yes, that's what I should have done and will do.
>>
>>Still, the Moved() event at form startup sure seems strange.
>>
>>Thanks Gerald
>
>I have do a simple test. I have put a [wait window "moved" nowait] in the moved event of a form. When I run the form, the wait window do not show until I move the form by its title bar.
>
>I suspect that it was your code that move the form during the init.

Not as I can tell/see. The coverage log NEVER went to Moved() through the whole Init().
In addition, it DID execute my method for the new placement of the form and later testing showed that the input to it are Top=0 and Left=0 despite the fact that the memo field (loaded to a property of my 'framework' in MAIN) does have other values at startup (but the Moved() event code *does* (well, did, until I made the change you suggested) change the values in the property).
So I can only conclude that the Moved() event was triggered BEFORE the Init() event and that does not seem correct (or at least logical) to me.

It's not a problem doing it the smart way (at close only) so now it is only a matter of academic interest.

Cheers



>When you change the value of Top or Left to reposition the window to the last position, your code in the moved event override the last position with the current (at least one of the 2 params). If you change Top with the old Top, you override the old Left with the current Left (vice-versa).
>
>All in all, the moved event will not be triggered without an implicit move manually or by code. :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform