Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto push the button
Message
De
06/08/2004 13:06:45
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00931256
Message ID:
00931366
Vues:
16
>When You push some button, Click event occured, so You can do this (If I undestood You right):
>
>
>SCAN
>  thisform.Next.Click()
>  thisform.Edit.Click()
>  thisform.Save.Click()
>ENDSCAN
>


Borislav:

I know you know this but he may not. Although technically correct, that would be bad design. Buttons with a lot of code in their Click() method may not be reusable, which breaks one of the main reasons for OOP in the first place. He should be better served by adding methods to the container object (a form in this case), like:

ThisForm.OnSave() or ThisForm.SaveAction() and call those from the ButtonSave.Click() and directly when used programatically.

See:
http://fox.wikis.com/wc.dll?Wiki~MethodsShouldNeverCallEvents
http://fox.wikis.com/wc.dll?Wiki~EventsShouldAlwaysCallMethods


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform