Information générale
Catégorie:
Codage, syntaxe et commandes
>only if you call the internal event (e.g form::destroy(),
>textbox::keypress(nKeyVal,nALTSHIFTCTRL etc.)
>
>Arnon
>>I presumed that whatever internal code does not get executed when you do
>>NODEFAULT, would get executed when you manually call the event!
>>
>>Darrel
>>
Oh, now I understand. This is getting ridiculous. If the event method is called manually the base class method is not called automatically, but if that same event method is called by an event the base class event method is called automatically. I guess this is justification enough never to call an event method directly!
I would have much prefered if MS had told us that if we were going to override an event we had to place a DoDefault() at the end of our code so that at least the behaviour of a base class would be consistent with that of a subclass. They could even autoinsert the DoDefault() into any event method as the do with methods that have parameters.
Thanks,
Darrel
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