Information générale
Catégorie:
Codage, syntaxe et commandes
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
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