How to release a form from another form 
Author Message
 How to release a form from another form

Form1 is opened with do form form1

and then

form2 is opened with do form form2

When I try to close form2 from form1 with form2.release() it gives me an
error message stating:
"object form2 is not found"

Can I close a form from within another form.

Thanks



Sun, 23 Feb 2003 02:47:25 GMT  
 How to release a form from another form

You're going about it the wrong way..

Just open the first form.....
from there open another form
to get out of that 2nd form and back to the first form
put a quit button on 2nd form which has;-

thisform.release

You close forms from themselves..... not from the forms
that called them.
Regards,
Derek.


Quote:
> Form1 is opened with do form form1

> and then

> form2 is opened with do form form2

> When I try to close form2 from form1 with form2.release() it gives me an
> error message stating:
> "object form2 is not found"

> Can I close a form from within another form.

> Thanks



Sun, 23 Feb 2003 03:00:56 GMT  
 How to release a form from another form

Thanks for your reply.

I am aware of how to close forms from within themselves but I wanted to know
if I could actually close a form from within another form.

Any feedback would be appreciated!!!


Quote:

> You're going about it the wrong way..

> Just open the first form.....
> from there open another form
> to get out of that 2nd form and back to the first form
> put a quit button on 2nd form which has;-

> thisform.release

> You close forms from themselves..... not from the forms
> that called them.
> Regards,
> Derek.



> > Form1 is opened with do form form1

> > and then

> > form2 is opened with do form form2

> > When I try to close form2 from form1 with form2.release() it gives me an
> > error message stating:
> > "object form2 is not found"

> > Can I close a form from within another form.

> > Thanks



Sun, 23 Feb 2003 03:30:58 GMT  
 How to release a form from another form
public yyy
Do form xx name yyy linked

Now you have a public handle. If you want a system without public vars,
create a custom object for holding form references, or add a form-array
prop. to _screen with .addpropery

Robert


Quote:

> Form1 is opened with do form form1

> and then

> form2 is opened with do form form2

> When I try to close form2 from form1 with form2.release() it gives me an
> error message stating:
> "object form2 is not found"

> Can I close a form from within another form.

> Thanks



Sun, 23 Feb 2003 05:49:57 GMT  
 How to release a form from another form
I you do it like this:

Do FORM .\FORMS\melding.scx NAME frmwait
Do FORM .\FORMS\melding2.scx NAME frmstop
Do FORM .\FORMS\melding3.scx NAME frmmore

Can you not close the forms with the name

frmwait.relase
frmstop.relase
from any of the other forms ?????

I Have not tried it but you shold



Quote:
> public yyy
> Do form xx name yyy linked



Sun, 23 Feb 2003 06:14:13 GMT  
 How to release a form from another form

Alex,

when the user at runtime changes language in our apps. all forms are updated
immediatly
It happens in a loop where all open forms have called their show-methods.
Here is the code for it.
Maybe you can use it to perform a release on you specified form.

Cheers
Carsten

<code start --------------->
procedure RefreshApplication
local nCnt
local oActiveForm

 oActiveForm= _Screen.ActiveForm
 for nCnt= 1 to _screen.FormCount
  if !Alltrim(_screen.Forms[nCnt].Tag) == ':NOSHOW' then
   _screen.Forms[nCnt].Show()
  endif
 endfor
 oActiveForm.Show
endproc
<code end --------------->

Alex schrieb:

Quote:
> Form1 is opened with do form form1

> and then

> form2 is opened with do form form2

> When I try to close form2 from form1 with form2.release() it gives me an
> error message stating:
> "object form2 is not found"

> Can I close a form from within another form.

> Thanks



Sun, 23 Feb 2003 15:20:34 GMT  
 How to release a form from another form
Or if you don't want to do this:

FOR EACH loForm IN application.Forms
    IF TYPE("loForm") == "O" AND loForm.Baseclass == "Form" AND
upper(loForm.Name) = 'FORM2'
        If loForm.QueryUnload()
            loForm.Release()
        EndIf
        Exit && Stops to loop
     ENDIF
ENDFOR

<Help>
An object created for each instance of Visual FoxPro that exposes a set of
Visual FoxPro properties and methods.
</Help>

Greetings,

Ko Wisse
VFP'er
FlexiSoft
the Netherlands



Sun, 23 Feb 2003 15:28:48 GMT  
 How to release a form from another form

Try the do form named xxx linked.  This will create a variable with which to
reference the form2.  When you release that variable, the form wil be
released


Quote:
> Form1 is opened with do form form1

> and then

> form2 is opened with do form form2

> When I try to close form2 from form1 with form2.release() it gives me an
> error message stating:
> "object form2 is not found"

> Can I close a form from within another form.

> Thanks



Sun, 02 Mar 2003 00:36:44 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Release form problem (after filling form property)

2. release form - from menubar of top level form ?

3. DO FORM and RELEASE FORM troubles.

4. vfp7 form.release or release window?

5. form.Release not releasing

6. releasing all active forms

7. Release Forms - Toolbars

8. Form.Release failure in VFP 6.0

9. Form release problem

10. Automatically releasing all opened forms in an application

11. Closing/Releasing a Form

12. releasing a form, with QueryUnload

 

 
Powered by phpBB® Forum Software