Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form is blank at runtime 1

Status
Not open for further replies.

CEMrob

Programmer
Sep 2, 2008
24
GB
VFP9 (sp2) with Windows 7. I am designing a form with various objects, but nothing special, just standard text boxes, grids etc.

I have been gradually modifying and testing the form, both by building it into an app and calling it from a cmd button from another form, and also using 'run form' at design time.

Suddenly the form has started coming up blank, with no objects on it, just the border, caption and the normal min,max,close controls. I've tried restarting VFP, rebooting the computer, and tweaking various display properties (though I hadn't changed them before the problem appeared) all to no avail. Something somewhere is corrupt, and I have no idea where to start looking. Any suggestions either has to what may have happened, or as to what diagnostic procedures I could try?

Many thanks.
 
For people beginning with Visual Foxpro I typically recommend that they spend some time looking over the various free on-line tutorial videos about VFP at:
Windows 7 has a few of its own 'gotchas' which have to be taken into account such as which folders you are allowed to use and which you are not, but you should first get the basics of VFP development down solid.

Suddenly the form has started coming up blank...

One thing we ALWAYS want to know is, if something seemingly suddenly changes its behavior - what was changed?

Identify that to yourself and then backtrack through those changes until things work again and you will have found the cause of your problem.

Good Luck,
JRB-Bldr
 
Did this form start in VFP or was it converted from FPW?

(The latter is a common problem you can fix by setting _Screen.Themes = .f.)
 
CEMrob,

Is the form blank at design time and run time? Or just at run time (in other words, can you see the control in the form designer)?

If the controls are still present at design time, is it possible they are getting made invisible for some reason? Or is it possible that the form is being resized and the controls are outside the visible area?

One way of checking this is to run the form as usual, then suspend the program. This will bring up the command window. You can then interrogate the properties of the controls by typing commands in the command window.

For example, type ? MyForm.Command1.Visible to find out if the control is present but invisible, or ? MyForm.Command1.Top and ? MyForm.Command1.Left to find its position relative to the form. (You should also type ACTIVATE SCREEN before doing this, so that the output is sent to the background screen.)

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks for the thoughts everyone.
1. I have been programming in VFP for quite a few years & in fact started out with dBase II (on CPM!) and moved through various incarnations of FoxBase and then FoxPro - I've never encountered this problem before.
2. The form is absolutely fine at design time till I select "Run Form" from the Form menu.
3. Immediately prior to the problem "suddenly" appearing, I had added a Dblclick method to a Header in a grid in a Pageframe.
4. I undid that change but the aberrent behaviour continues. In fact I removed the grid altogether, but to no avail.
5. I have examined all the form settings and they are fine.
6. I 'saved as' to a new form, tried that, and it too misbehaves.
7. I have tried it out on two other computers, one running XP pro and the other MS Server 2003. Same same.
8. I'd almost given up, then tried one last trick: created a new form altogether, made sure the settings are as I want them (modal, visible, themes on etc) (and indeed, exactly as they are in the original form) then simply copied and pasted all the objects and methods from the old form. Voila, it works perfectly.
9. So, to all outward appearences both forms are identical, yet one works, the other does not. Life is too short so I'll just consign this mystery to the files of Arthur C Clarke and move on.

But thanks again - I was up most of last night working on this, and to get 3 replies within a matter of hours is very gratifying, brilliant forum.
 
It's good to hear that you've got past the problem (it would have been nice to have found the reason for it, but, as you say, it's just one those mysteries).

Now that you've found us, be sure to come back.

Mike
P.S. I was also a dBASE II and CP/M guy. Wasn't life simpler in those days?

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
@Mike
Oh yeah....(sigh)
Only 8 bits to the pound, and Alan Sugar was still just a horrible dream.
 
Just one further thought. Is it possible that somewhere in your code, you set LockScreen to .T.?

Tamar
 
Well. Now I feel like a complete idiot. LockScreen is indeed set to .T. in the non-working form: resetting it to .f. works a treat, and there I was protesting that all basic form settings in the working and non-working versions were identical. Words like "wood", "trees" and "not seeing" come to mind.

Many thanks Tamar, I hate unsolved mysteries although now I wonder how anyone managed to hack into my computer just to change that setting without me noticing.
 
It may not be your fault.

Some of the wizards and builders used to leave LockScreen set (in error, IMO) and since it wouldn't occur to you to set it you could spend hours not finding it.

It happens to all of us.
 
Hi CEMrob,

Reading your story about reconstructing a form: maybe it is now time to make use of the possibility and make an automatic backup of your scx, vcx files with a projecthook? I believe the time spent to deploy such a hook will be earned back on the next occasion.
Examples of such a backup routine can be found in 1000 Things or here: Regards,

Jockey(2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top