Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can execute a button click method without showing the fo
Message
From
25/09/2019 08:15:12
 
 
To
25/09/2019 07:16:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01671046
Message ID:
01671109
Views:
59
>>>Just to clarify, when you are saying "never be calls to event method", you mean never code like this?
>>>
>>>*-- Some procedure or a method calling the click of a button:
>>>SomForm.cmdSomeButton.Click()
>>>
>>
>>Yes, that's what I mean. If you find yourself writing code that calls Click or KeyPress or GotFocus or ..., that code belongs in a method that's called from the event and from whatever the other place is.
>
>Almost as a rule, as soon as I moved the code from .click() of a button into a form's method, there would arise another place which would need to use the same code - either a popup, or a toolbar button, or some bound event. Only in rare occasions would the button be the only caller of that method.

Why not just call the .click() event to run the code from those new places that pop up?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform