Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible bug in Form refresh with custom class - VFP6
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Possible bug in Form refresh with custom class - VFP6
Divers
Thread ID:
00557755
Message ID:
00557755
Vues:
69
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
Fil
Voir

Click here to load this message in the networking platform