Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do I need DoDefault() in Refresh()?
Message
De
10/03/2021 22:47:05
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01678879
Message ID:
01678904
Vues:
40
Hi Dmitry.

>I have some code in the form method Refresh(). In the end of this code I have dodefault(). I also added some test code into a container's Refresh method (just to see when it fires). So, when I have DODEFAULT() in Refresh method, the Refresh of the Container fires twice on every record move. If I comment the DODEFAULT() in the form Refresh(), the Refresh() in the container fires once.
>Which brings me to the question, what is the purpose, and if I need, DODEFAULT() in the form refresh()?

You don't need a DoDefault() in the Refresh code.

DoDefault() is used to call the code that would have been called it your code wasn't there. Some methods on objects are actually event handlers and operate differently than normal methods. It can get a little confusing. Refresh is one that will propagate without your help. For those sort of code blocks you can use the NoDefault statement to prevent that. For example, if you include a NoDefault in KeyPress() then the key event won't reach the handler that processes it. That would prevent the character from appearing in a TextBox for example. You can even do a NoDefault and then a DoDefault() to pass different information than was intended.

Ian Simcock.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform