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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a form

Status
Not open for further replies.

davidb88

Technical User
May 3, 2012
5
GB
Hello,

I can close a form with formname.release. But what would I use to reopen the form?

Thanks,

David
 
How you re-open a form that you have closed is no different from how you open the form in the first place. If you used DO FORM or CREATEBOJECT() to open the form, use exactly the same code to open it again.

But, maybe you mean something else. Do you mean that you want re-open it with all its contents exactly as it was when it was closed - including any data that the user has entered? If so, don't close it and re-open it, but simply make if invisible, and then make it visible again. You do that by setting the form's Visible property to .F. amd .T. respectively.

But I'm just guessing what you want to do. If the above doesn't answer your question, please clarify what you are trying to achieve.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
If I view it from the other angle:

If you want to be able to reopen that form with all the data in it and it's state, then you can't do that after you exited the form via form.release().

What you can do is form.Hide() to hide a form and then form.Show() to re-open it. What you need to call form.Show() of course is a variable holding a form reference.

In the first place you can do the following:

Code:
PUBLIC formvariable
DO FORM yourform NAME formvariable

Then later you can do thisform.Hide() within the form and then to reshow
Code:
formvariable.Show()
* OR
formvariable.visible = .T.

Using a PULBIC variable is just for ease of the sample code. You should avoid scattering your code with public variable names for each form, a nice thisg to do is adding a Collection class object to _screen and adding form references there.

Bye, Olaf.

 
David,

Are you still here? You've had two replies to your question. It would be helpful to know if the replies were of any use to you, or if you still have a problem.

(The same applies to your other questions, on the LOCATE command and calling an event from another form.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top