Microsoft KB Archive/146223

= FIX: Position Error: Outline Control on Classed Pageframe =

Article ID: 146223

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 Q146223



SYMPTOMS
If an outline control is placed on a page of a pageframe and that pageframe is saved as a class, the class is repositioned during its use in designing a form. The outline control will first appear in its original design location when the form is run. Then if you click an alternate tab of the pageframe followed by clicking the original tab, the outline control jumps to that location on the page in the form.



WORKAROUND
To correct this behavior in the design of the form, use the following steps, which are based on building a test example as specified in the "Steps to Reproduce Problem" section of this article.

  Place the following two commands in the form's Activate event: Thisform. .Pageframe1.activepage = 1 Thisform.refresh   Place the following command in the Init event of the form: Thisform.refresh   Place the following command in the Init event of the pageframe of the current instantiation of the class: This.activepage = 2   Place the following command in the Activate event of the page that contains the Outline control: This.refresh 



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.



Steps to Reproduce Problem
Using the Visual FoxPro interface, create a new class consisting of a pageframe that contains an OLE container control that contains the Outline control on the first page. Place this class in the upper-left corner of a form. Drag the class to the lower-right corner of the form. Run the form and observe the position of the outline control. Here are the steps:

 On the File menu, click New, select Class, and click the New Class button. In the New Class dialog box, click Based on, and then click Pageframe. Give it a class name of Outltest, and store it in a class library named Testvcx.vcx.</li> In the Class Designer, right-click the pageframe, and select Edit.</li> From the Forms Control toolbar, select the OLE Container Control tool, and place it on the first page of the pageframe, which is in Edit mode.</li> In the Insert Object dialog box, click Insert Control. Then from the Control Type list, select the Outline Control. Position and size the outline control on the pageframe so that it looks as you would want it to look on a user's form. Then save the new class, and close the Class Designer by using the menu options or by pressing CTRL+W.</li> In the Command window, type:

MODIFY FORM outltest.

</li> On the Forms Controls toolbar, click the View Classes button. Click Add, and sele Testvcx.vcx from the Open dialog box. Click Open.</li> From the Forms Controls toolbar, click the Outltest class tool, and place the class on the form in the upper-left corner. Drag the class to the lower-right corner of the form.</li> Click the exclamation mark tool on the Visual FoxPro toolbar to Run the form. Observe that the OLE Outline control is positioned off of the pageframe. Click the tab for page 2 of the pageframe, and then click the tab for page. Observe that the Outline control is now located where it should be.</li></ol>

Additional query words: jump misplace

Keywords: kbbug kbfix kbvfp500fix KB146223

-

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

© Microsoft Corporation. All rights reserved.