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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird Issue with containers

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
I think my FVP installation is corrupt, anyone seen this behaviour?

I have 45 containers on a form. Each container contains another nested container and a label.
When I run the form, the form freezes. If I reduce the quantity if the containers to about 15, the form will load but with visible delay
To bug test this, I tried this with zero code. The form with no code in the load or init
The containers contain no code.
But if I have 45 containers that do not have nested containers, everything is fine

Before I re-install VFP, anyone seen this behaviour before?

Oh and by the way, I tried creating new projects etc to test this. This is not a class issue with inheritance etc
 
It must have to do with something more, as the form also doesn't freeze without a textbox, when less than 16 containers are visible.
That isn't explained by not finding a focus. Not finding a focus will even happen for any empty form and empty forms are dull, but work, ie o=CreateObject("form"), o.Show().

At least the reason of focus is explaining why the form designer has no problem with such a form, it doesn't run the form, there is no focus to set during design time.
Also the form with many grids works, as grids can have focus...

Bye, Olaf.
 
>Very nice and useful (as usual) investigation.

Thanks for pointing that out, atlopes. A bit of luck was in it, too. Imagine I would have put a button on the form instead of programming the form.click event, then this way I could have set all containers visible without problems and would have thought you just have to set a larger number of controls visible one by one to let VFP adjust to the situation.

There's often reason for false assumptions and the thing I'm satisfied with is having been sure about no reason a reinstall could help. If I look back I see many people do reinstalls regularly, my oldest VFP9 installation is not the first one I did, but the only reason I went through more installs was changing PCs. There's very little, which could get broken with VFP itself, rewriting foxuser is often good enough, I also had broken foxcode.dbf which shows in intellisense fails, sometimes C5 when you just type a space, because it triggers lookup in the foxcode.dbf by intellisense and if that dbf is broken, one leads to the other.

The most shameful thing is blaming Windows Updates. You can't rule out anything for sure, but you also shouldn't get too sure about anything before testing thoroughly what happens if you experiment with a few things. It was surely not impossible graphic drivers could be involved, but it was quite clear it had to be something VFP or GDI related, once I could reproduce this on several PCs.

The silly thing is an application I maintain has a form with many shapes resembling the lables of a label sheet, so you can choose which label to set as report start label and reuse half or quarter used label sheets this way. Today that's outdated with extra label printers printing from label rolls. I think it's shapes, not buttons or containers, but this isn't the lucky part, it also has a few other controls on it for specifying margin, so it doesn't have the focus problem, it could easily be a candidate to not work, if it only had the shapes.

Bye, Olaf.
 
Tested and proved as well, and problem solved.
Certainly explains why the form worked before then failed to work later. I had a few controls on the form for bug testing purposes and were deleted later as the form was cleaned up.
So easy to get tripped up on something so simple, yet very puzzling.

Excellent work guys and thank you so much.

Alastair
 
Fine,

now to get a form with focus, but without visible focus, you could add a Commandbutton and do nothing in its click. Set its position off the form (i.e. top = Form.Height + 10) and if your form should be resizable anchor it so it stays off the visible form canvas. Anchoring to the bottom border with absolute distance should keep it at whatever current height+10, invisible. Not sure, whether you could also position with negative top/left, that wouldn't even need any anchoring to stay off.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top