Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is the Height of the PageFrame automatically increasing?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00730159
Message ID:
00730228
Views:
19
This message has been marked as the solution to the initial question of the thread.
Hi Allan.

Is it possible that the height of a pageframe is automatically increasing to accommodate the amount the captions for the pages?

Andy and I talked about this at the beginning of last month's Kitbox column in FoxTalk magazine and, unfortunately, you are out of luck because this looks like a bug:

Andy: Well, Stanley Barnett asked a question in the MS Developer Apps forum on Compuserve (http://forums.compuserve.com/vlforums/default.asp?SRV=MSDevApps). He found that when adding pages dynamically to a pageframe that the tabs crept down the page, obliterating the controls, when a new row of tabs was added.

Marcia: Ouch! That is nasty. I presume that those fields you are showing are accurate? It means that although the pageframe does get taller, it’s height property does not change, so you can’t detect the fact.

Andy: Yep, that’s the bug! Since the page does not have its own TOP property, the only way to calculate where a control should be placed is to use a formula like this to calculate the ‘top of the visible portion of the page:
VisibleTop = PageFrame.Top + (PageFrame.HeightPageFrame.PageHeight))
Marcia: Sorry, but that formula won’t work. You need to use ObjToClient() to find the top of the page. Even though the page does not have its own Top property, ObjToClient() will give you top of the page relative to the form. The formula you need is, therefore:
VisibleTop = (PageFrame.Height - PageFrame.PageHeight) - OBJTOCLIENT( Page, 1 )
Andy: Oh I see. Even so, it doesn’t help because the pageframe’s properties are not changing when it grows to accommodate the new row of tabs. While that formula works perfectly however many rows of tabs the pageframe has when instantiated, it fails as soon as another row is added dynamically. For Figure 1, the value calculated for the top of the visible page was +34 for the single row of tabs, but –29 for the second!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform