Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show forms

Status
Not open for further replies.

choppysuey

Technical User
Mar 28, 2001
54
US
Hi everyone,
I'm running VFP 6 and had a quick question on hiding and showing multiple forms. If I have a command button on form1 that basically does this:

thisform.hide
do form form2

and then on form2 I have a command button that does this:

this form.hide

With both forms now hidden. How do I go about showing these forms again?

Thanks in advance

-suey
 
if you use do form MyForm name Form1

Then you can reffer to it by saying from1.show() and son on..


Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
choppysuey

You have to use a public reference (variable) to the form. Try this:
PUBLIC oForm1,oForm2
DO FORM form1.scx NAME oForm1
oForm1.hide
DO FORM form2.scx NAME oForm2

Now you can reference your forms from each other.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks for the response. Much appreciated. It did the trick. Is there a built in function that I can use to check if an object exists? I found the list object command but can't seem to find one that will tell me what objects are currently created.

 
choppysuey

IF VARTYPE(oForm1) = "O"
MESSAGEBOX("Form exists")
ENDIF


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top