Solved

foxpro 9 formset issue

Posted on 2013-06-28
6
725 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

733 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