Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

foxpro 9 formset issue

Posted on 2013-06-28
6
Medium Priority
?
798 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 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
Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

 
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

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.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

705 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