Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>I know that click method does not allow embedded procedures.
>
>But is there any trick to execute a small piece of code inside the method,
>calling it with Do, or other command ?
>
>It would be very useful because when you write inside a procedure it will not work,
>if inside the procedure there are lines as thisform.command1.click, etc.
I'm not exactly sure what you're asking, but in general the right way to handle a piece of code that you need several places is to create a custom method at the appropriate level and call it where you need it.
So, if you'll need this code in a number of different command buttons, add it as a custom method to your button class. If you'll need it from a number of different places in a single form, add it to the form. If you'll need it in a number places in a number of forms, add it to a form class. If you'll need it throughout your application, add it to your application class.
Tamar
Précédent
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