Dear all,
I would like to know the behaviour why a form is initialised differenty via a DO FORM statement verses a CreateObject?. The follow simple example would be able to simulated the problem.
1) Create a form with a pageframe and in page one place two text box. In the second textbox, in the INIT method have this line of code
THISFORM.PAGEFRAME1.PAGE1.Text1.Value='1234'
Run the form
2)Save this form as a class. Now Try to initialise the form via CreateObject().
The second instance failed because in the INIT method. If I replace the code with THIS.PARENT.Text1.Value="1234", it works. Also in this case the sequence in which the object is created is also important. Whereas with the DO FORM method this is not important.
From my observation, It seems that with the DO FORM all the objects are first created and then the INIT are then called. With Class, object is created and then INIT is called immediately. I would like to know if this is behaviour by design or a bug. I would like to hear suggestion as to how best as to avoid this problem, in another words best practice approach.
I have VFP6 with SP4 and the same problem occurs in W2K as well as Win98. Thanks.
Regards,
Kueh.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement