Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

foxpro 9 formset issue

Posted on 2013-06-28
6
Medium Priority
?
821 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 43

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 30

Accepted Solution

by:
Olaf Doschke earned 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 43

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 30

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

971 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