FIX: Resize Event Automatically Called in SubClassed PageFrame (157359)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0

This article was previously published under Q157359

SYMPTOMS

The Resize event of a subclassed PageFrame is called automatically when the object is being instantiated.

WORKAROUND

One way to prevent the Resize method code from being executed where the object is being instantiated is by setting a public variable, or user- defined property, in the PageFrame Init event and checking the variable in the Resize event.

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.0a.

MORE INFORMATION

The Resize event of a PageFrame is called only if the Resize event is explicitly called from within the code. If not, the Resize event is not called automatically. The above symptom occurs in only a subclassed PageFrame.

Steps to Reproduce Behavior

  1. Create a PageFrame control in the Class Designer.
  2. In the Resize event of the PageFrame control, put in the following line of code:
          WAIT WINDOW "Resize - PageFrame Class"
  3. In the Init event of the PageFrame control, put in the following line of code:
          WAIT WINDOW "Init - PageFrame Class"
    						
  4. Save the Class.
  5. Create a form.
  6. Add the PageFrame class that you just created in Class Designer onto the form.
  7. Save and run the form. The PageFrame Resize method fires as evidenced by the Wait Window "Resize - PageFrame Class" appearing.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbProgramming kbvfp500aFIX KB157359 kbAudDeveloper