Microsoft KB Archive/191998

= BUG: Form Cannot Override Parent Class AutoCenter Setting =

Article ID: 191998

Article Last Modified on 8/13/1999

-

APPLIES TO


 * 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 Q191998



SYMPTOMS
Changing the AutoCenter property of a form based on a parent class, will not override the AutoCenter setting of the form's parent class.



RESOLUTION
Use the ResetToDefault method to set the Top and Left property in the Init method of the subclassed form, when the AutoCenter property of the Parent class is set to .F..

For instance, put the following code in the INIT event of the form: This.ResetToDefault("Top") This.ResetToDefault("Left")



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.



Steps to Reproduce Behavior
  Create the parent class by issuing the following command from the Command window: CREATE CLASS Myform OF test.vcx AS Form  Once the Class Designer appears, change the AutoCenter property of the form in Class Designer to .T.. Save the class and close the Class Designer.  In Visual FoxPro 6.0, issue the following command from the Command window to create a form based on Myform: CREATE FORM mytestform AS myform FROM test.vcx If you issue the preceding command in Visual FoxPro 5.x, you will get an error because the command is not yet implemented. To do the same in Visual FoxPro 5.x, you must set the parent class form as a form template Class. To do this, from the Tools menu, choose Options and then click the Forms tab.

 In the Form Designer, change the AutoCenter property from .T. to .F.. Save and run the form.</ol>

The form still shows up in the middle of the screen even though the AutoCenter property is set to .F..

Additional query words: kbVFp600bug kbVFp500abug kbOOP kbvfp500bug

Keywords: kbbug kbpending KB191998

-

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

© Microsoft Corporation. All rights reserved.