PRB: Calling Paint Method Can Cause Recursion in VFP 5.0Last reviewed: October 29, 1996Article ID: Q156873 |
The information in this article applies to:
SYMPTOMSSetting the Caption property of an object in the Paint event causes Visual FoxPro to recursively call the event.
CAUSESetting or changing the Caption property repaints the object. However, repainting a form or tool bar triggers the Paint event. Therefore, Visual FoxPro enters into a recursive loop.
RESOLUTIONDo not place code in the Paint event that causes a form or toolbar to repaint. Place code that refreshes a form or toolbar in an event that does not call itself recursively. For instance, if the Caption of a label requires changing, place the code in the Refresh method, LostFocus, or Click event of an object.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce BehaviorWARNING: Close all running applications and save your data before following this procedure. To close all open applications in Windows 3.1, press the CTRL+ESC keys to open the Windows Task List, and then close all the other applications you have running. In Windows 95 and Windows NT, press the CTRL+ALT+Delete keys simultaneously to invoke the Close Dialog window or the Task Manager, respectively. The following the steps will cause Visual FoxPro to enter into a recursive loop. Therefore, Visual FoxPro must be shutdown using either the Windows Task List, Close Program dialog box, or Task Manager.
|
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |