PRB: Calling Paint Method Can Cause Recursion in VFP 5.0 (156873)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q156873 SYMPTOMS
Setting the Caption property of an object in the Paint event causes Visual
FoxPro to recursively call the event.
CAUSE
Setting 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.
RESOLUTION
Do 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.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | KB156873 |
---|
|