Solved

foxpro 9 formset issue

Posted on 2013-06-28
6
652 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 41

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 41

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now