Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto push the button
Message
From
06/08/2004 13:06:45
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00931256
Message ID:
00931366
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform