Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Child Form Disapear
Message
 
 
À
28/04/1999 03:46:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00212889
Message ID:
00212927
Vues:
23
Oliver,

The problem is you are creating a private memvar in the method to hold the child form object reference. When the method ends, the memvar goes out of scope and takes the form away. In your architecture you could 1) make the child form Modal or 2 )use a property of the parent form to hold the child form reference: thisform.oChildForm = createobject(...)

Also you do not need the second READ EVENTS the first one executed is the only one that has any effect on the system.

>When I call a form (parent) and the call the other form (child), why the child does not appear, it just fresh once and the return to parent form.
>Thank you!
>
>ObjMenu=CREATEOBJECT("FrmMenu")
>ObjMenu.Show
>READ EVENTS
>
>DEFINE CLASS FrmMenu AS FORM
> Caption="Menu"
> Top=1
> Left=12
> Height=230
> Width=220
> AutoCenter=.T.
>
> ADD OBJECT Option1 AS COMMANDBUTTON WITH;
> Caption="Sub Program",;
> Top=20, Left=40, Height=50, Width=140
>
> ADD OBJECT Option3 AS COMMANDBUTTON WITH;
> Caption="Exit",;
> Top=160, Left=40, Height=50, Width=140
>
> PROCEDURE Option1.Click
> thisform.Visible=.F.
> DO SubProgram
> thisform.Visible=.T.
> ENDPROC
>
> PROCEDURE Option3.Click
> Clear EVENTS
> ENDPROC
>ENDDEFINE
>
>
>PROCEDURE SubProgram
>ObjSubPrg=CREATEOBJECT("FrmSubPrg")
>ObjSubPrg.Show
>READ EVENTS
>RETURN
>
>DEFINE CLASS FrmSubPrg AS FORM
> Caption="Sub Program"
> Top=10
> Left=10
> Height=150
> Width=150
>
> ADD OBJECT CmdExit AS COMMANDBUTTON WITH;
> Caption="Exit",;
> Top=20, Left=40, Height=30, Width=100
>
> PROCEDURE CmdExit.Click
> thisform.release
> ENDPROC
>ENDDEFINE
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform