Solved

foxpro 9 formset issue

Posted on 2013-06-28
6
710 Views
Last Modified: 2014-04-14
I am creating a formset in foxpro 9.0.  I have 2 issues.  1: now matter where or how often I insert thisformset.form2.visible = .F., including the properties of the form.  It is always visible when the main form loads.  If I insert code after that, visible = .F. works.  I also set enabled = .F.,  This seems to work.  also, since this is the last of 2 forms, the focus always is on form2 when it loads, even though it is not enabled.
2.  when I make form2 visible, enabled and setfocus() to a textbox.  The code following this in a click event still processes.  I am trying to call form2 that produces a data item that will be placed in the value of form1.text1.  the program sends focus, visibility to form2 but doesn't wait for focus to return.  therefore the value returned never makes it to form1.text1

Thank you,

Mark Buckley
0
Comment
Question by:BUCKBERG
  • 2
  • 2
  • 2
6 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 39285074
Formsets are obsolete aproach to simulate backward compatibility to screen sets from FoxPro 2.6. OTOH, they are still often used...

You cannot set property of non-existing form by thisformset.form2.visible = .F.
I don't know why there is no error reported but the form exists after its Load and Init mothods call.

Also if you create another form from the existing form and call some SetFocus, the code continues because FoxPro supports multiple forms at once.

You could create two independent forms and create the second one as Modal. When you call the second form the program flow stops on the DO FORM command  and waits until the modal form is closed. Of course, the called form must return the value or you have to pass THISFORM reference to the called form which allows to set any public property in the calling form. More info is in VFP help under the DO FORM topic.

If you don't like the two independent forms idea then post some code which your are using in your formset and we'll find a solution for formset.
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 39285234
Formsets to me are also obsolete, simply because of the zorder problems they introduce. It has gotten unbearable.

To share a data session, you can nowadays use a dataenvironment class or you have your main form with a private data sessions and start satellite forms with a default data session.

Besides the visible property of a form never was really an important property, it's indirectly set when using forms Show() and Hide() methods. And you should be able to start a formset as any other single form scx by DO FORM... NOSHOW, of course best used together with the NAME clause to be able to address the formset and FSetName.Show() it or some form of it.

Bye, Olaf.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 39285596
If you wish to hide a form simple put it's Left or Top to -Width or -Height.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 42

Expert Comment

by:pcelba
ID: 39286512
You can make the form inside a formset invisible very simply: Set the Visible property to .F. at design time. You can show the form very simply:

THISFORMSET.Form2.Visible = .T.
THISFORMSET.Form2.ZOrder(0)

You can optionally disable the Form1:
THISFORMSET.Form2.Visible = .T.
THISFORM.Enabled = .F.
THISFORMSET.Form2.ZOrder(0)

You could even hide the Form1 but don't forget to make it active and visible when the Form2 becomes hidden or destroyed.

I am not using formsets so I also don't know problems with ZOrder. Simple example with two forms has no ZOrder problem in my case.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 39286593
The problem arises, if you use several formsets in parallel.

I also had other problems with forms not leaving lockscreen. I don't care to write repros for that, it's lost. Formsets are quite useless, I can do without them.

Bye, Olaf.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 39286640
I tried using Formsets once in FPW26 and once in VFP6. There was not much benefit from them so I decided to do it in another way.

My latest VFP forms were really HTML. The user mostly interacted with HTML using a WebBrowser Control and the dialogs were VFP screens for selection or input. Why? HTML is the best layout and there is no limit as to what one can do. Even the reports are HTML, Excel and PowerPoint. I did not use any report form in VFP from 6 to 9.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
This article will show, step by step, how to integrate R code into a R Sweave document
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question