Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you release other FORMS opened ...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00044045
Message ID:
00044625
Vues:
42
>>>>>>>>>>>How do you release other FORMS opened from
>>>>>>>>>>>within a FORM.. I know I asked this question before
>>>>>>>>>>>and I thought I saved the answer. I want to close
>>>>>>>>>>>two opened FORMS.... thanks..rob
>>>>>>>>>>
>>>>>>>>>>***frmMain Destroy event (if you want to release 'child' forms too):
>>>>>>>>>>if type("Thisformset.frmDetail1")=="O"
>>>>>>>>>> Thisformset.frmDetail1.release()
>>>>>>>>>>endif
>>>>>>>>>>if type("Thisformset.frmDetail2")=="O"
>>>>>>>>>> Thisformset.frmDetail2.release()
>>>>>>>>>>endif
>>>>>>>>>>....
>>>>>>>>>>If you don't have Formset, try to use direct references to forms (from DO Form NAME clause).
>>>>>>>>>
>>>>>>>>>thanks Edward..these FORMS are not in a FORMSET yet, but
>>>>>>>>>as single FORMS I will like to release them.
>>>>>>>>>myform.release() does not seem to work.
>>>>>>>>
>>>>>>>>Look at DO FORM command. Does it have NAME clause? One thing beforehand: you can always use RELEASE WINDOW myform (to other UT members: don't crtiticize me too much for this not OO advice, please).
>>>>>>>
>>>>>>>DO FORM does have a NAME clause, but I want to release a FORM.
>>>>>>>How can you release a FORM with a DO FORM command?
>>>>>>
>>>>>>You can't. But if you give the form an explicit name when you DO it, you can use that name to Release: _screen.formname.release.
>>>>>
>>>>>I code this..
>>>>>DO FORM myform NAME anyform
>>>>>wait
>>>>>_screen.anyform.release
>>>>>
>>>>>this did not work...
>>>>
>>>>Where did you put this code? You realize that after you DO a form, control is passed to that form and does not return to the calling procedure until control is surrendered back? For debugging try:
>>>>
>>>>look at what _screen.activeform.name returns. Try to reference the form using that name.
>>>>
>>>>You are on the right track, I'm sure there is just something silly holding you up...
>>>
>>>Hi Erik - My problem is, I am trying to release a FORM that is not active
>>>and not part of a FORMSET.
>>>How do you release a FORM that is not the active FORM?
>>>I could use RELEASE WINDOW myform (thanks Edward)but I rather not.
>>>I tried DO FORM myform NAME anyform
>>>then....
>>>_SCREEN.anyform.RELEASE - but this does not work because anyform is not the
>>>active FORM.
>>>any more ideas?..thanks...rob
>>
>>For nLoop=1 to _Screen.Formcount
>> If _Screen.Forms(nLoop).Name="myform"
>> _Screen.Forms(nLoop).Release
>> Endif
>>Endfor
>
>thanks Edward for the code...Rob
I've been trying to do something similar: .Show other forms instead of releasing them. I ended up doing it the same way, by looping through _SCREEN.Forms(), looking for the .name property. I thought that if you don't use the NAME clause of DO FORM, then the name of the .scx file was the default object name. Though, as I say, making a name with the NAME clause didn't help me in this case.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform