Microsoft KB Archive/142282

= PRB: Pageframe Does Not Display All the Pages =

Article ID: 142282

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q142282



SYMPTOMS
Using RemoveObject and then AddObject to control pages in a PageFrame may result in a visual loss of pages.



WORKAROUND
Use either of the following two workarounds to prevent a visual loss of pages:

 Remove all pages before adding any new pages to the pageframe. -or-

  Remove pages in the reverse order in which they were added. Then add the new pages. For example, the following code adds three pages to a PageFrame: _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page1","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page2","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page3","Page") When you use RemoveObject, Page3 should be removed before Page2 and Page2 should be removed before Page1. After removing pages in the correct order, new pages can be added and displayed properly. 



STATUS
Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a new form in the Form Designer. Add a PageFrame to the form. Set the PageCount property of the PageFrame to 0.</li> Run the form.</li>  In the Command window, type the following: _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page1","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page2","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page3","Page") _SCREEN.FORMS(1).PAGEFRAME1.RemoveObject("Page1","Page") _SCREEN.FORMS(1).PAGEFRAME1.RemoveObject("Page2","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page1","Page") _SCREEN.FORMS(1).PAGEFRAME1.AddObject("Page2","Page") </li>  Open the debug window, and type the following: _SCREEN.FORMS(1).PAGEFRAME1.PageCount </li></ol>

The debug window shows the PageCount to be 3, which is correct. However, nly two pages are displayed in the PageFrame.

Additional query words: VFoxWin

Keywords: KB142282

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.