BUG: Pages of PageFrame Created with AddObject Method Invisible

Last reviewed: February 5, 1998
Article ID: Q180495
The information in this article applies to:
  • Microsoft Visual FoxPro for Macintosh, version 3.0b
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a

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. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a form called pageform.

  2. 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
    
    

  3. 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
    
    

  4. In the FoxPro Command window type the following command and then click page 6:

          DO PAGEFORM
    

    The pages display properly with the following changes to Pageform.prg:

    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.pageframe1.TABSTRETCH=pageform.pageframe1.TABSTRETCH
          pageform.REFRESH
       ENDDO
       RETURN
    
       DEFINE CLASS textboxa AS TEXTBOX
          TOP=25
          LEFT=10
          HEIGHT=20
          WIDTH=100
          VISIBLE=.T.
       ENDDEFINE
    
    

REFERENCES

(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by John Desch, Microsoft Corporation

Keywords          : VFoxMac vfoxwin
Version           : MACINTOSH:3.0b; WINDOWS:3.0,3.0b,5.0,5.0a
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug
Solution Type     : kbnofix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.