Microsoft KB Archive/180495

= BUG: Pages of PageFrame Created with AddObject Method Invisible =

Article ID: 180495

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b for Macintosh
 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q180495



SYMPTOMS
When using a multirow pageframe object, the currently selected page, pages on the same row, and controls contained on the selected page are not visible. This behavior only occurs when the TabStretch property of a pageframe is set to 0 - Multiple Rows.



CAUSE
When you add pages to a pageframe object using the AddObject method, Visual FoxPro may not correctly determine how the pages should display.



RESOLUTION
When you add pages to a pageframe object using the AddObject method, force recalculation of the page display by setting the TabStretch property of the pageframe to the existing TabStretch property value as shown below: pageform.pageframe1.TabStretch=pageform.pageframe1.TabStretch



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a form called pageform.  Add a pageframe object and set the following properties:      TabStretch : 0 - Multiple Rows - in Visual FoxPro version 5.x.      TabStretch : 0 - Stack         - in Visual FoxPro version 3.x.      Height     : 135 Width     : 330   Create a program called Pageform.prg using the following code: PUBLIC pageform DO FORM pageform DO WHILE pageform.pageframe1.PAGECOUNT < 12 lcpagename = "Page" + ALLTRIM(STR(pageform.pageframe1.PAGECOUNT+1)) pageform.pageframe1.ADDOBJECT(lcpagename,"Page") pageform.pageframe1.ACTIVEPAGE=pageform.pageframe1.PAGECOUNT lcpageadd="PageForm.PageFrame1."+lcpagename+ ; ".AddObject('TextBox1','TextBoxa')" &lcpageadd pageform.REFRESH ENDDO RETURN

DEFINE CLASS textboxa AS TEXTBOX TOP=25 LEFT=10 HEIGHT=20 WIDTH=100 VISIBLE=.T.     ENDDEFINE 

