>
> >I might be missing the point too, but if you suggest to duplicate the same code,
> >why not create a method with that code and just call it from Activate and Load?
> >Just an observation. But I think if Michel clarifies what exactly is going on, we
> >might come up with a workaround at least...Come on, Mich, tell us :) I kind of
> >missed the whole problem :(
>
> The main focus is to execute the code in the Activate() because this is the code being executed when we move from one form to another. I can't put this code elsewhere because it will not be executed as the Activate() is.
>
> In my app, I have multiple forms at the same time on the screen and the user can move to another one without closing it.
Michel,
I think Tom has a point. If I understand correctly you have some
settings that have to be done at 'form creation' time _and_ at
'activation' time. The problem being that at from creation, you also
'activate' the form and that the activate event is fired too late for
you purposes.
These settings are thus best but in some ad hoc method and called at
init time from the correct event (load, init, show, DE etc.) and by
Activate if the current form is being activated (but not initiated) like
for example when the user clicks on a deactivated form. You will also
need a property that tells you whether or not you are initiating or
activating your form.
let FormInitiated be that property and MyActivation be the method, you
set FormInitiated to .t. in the Init event, and in the Activate event
you put
if thisform.FormInitiated
thisform.FormInitiated= .f.
else
this.Activation()
endif
HTH,
Marc
If things have the tendency to go your way, do not worry. It won't last. Jules Renard.