Information générale
Titre:
Possible bug in Form refresh with custom class - VFP6
Hi,
using a custom form class, which has some code in the refresh event can lead to a double
refresh of all controls. This slows the whole form times 2.
How to reproduce:
Create a custom form class ("myform") and add to the refresh event some output lines:
e.g.
ACTIVATE SCREEN
? "FORMREFRESH"
Create a new form using the new class.
Put a text box on the form with a refresh event:
e.g.
ACTIVATE SCREEN
? "BOXREFRESH"
Put a command button on the form with a Click method:
THISFORM.Refresh()
If you run this form everything works OK: clicking the button leads to the following
output:
FORMREFRESH
BOXREFRESH
The bug occurs in the following case. Edit the new form's refresh event:
myform::Refresh && we inherit the class event code
... && any futher code.
Now we get the following output:
FORMREFRESH
BOXREFRESH
BOXREFRESH
All controls on the form are refreshed two times instead of one time. The class code is only
called once, but the VFP default refresh in the case of a form refresh refreshes all controls twice.
Andreas
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement