J'ai une méthode qui découvre des contrôles et ajoute des gestionnaires dans certaines situations.
'Voici un exemple simplifié.
'Est-il possible de passer dans le gestionnaire lors de l'exécution?
Private Sub Example(byval ph as Placeholder)
for each ctrl as control in ph.controls
if typeof (ctrl) is textbox then
dim cb as checkbox = ctrl
AddHandler cb.DataBinding, AddressOf MyHandler
end if
next
end sub
« Je cherche à faire quelque chose comme ça ...
Private Sub Example(byval ph as Placeholder, **byref method as delagate**)
for each ctrl as control in ph.controls
if typeof (ctrl) is textbox then
dim cb as checkbox = ctrl
AddHandler cb.DataBinding, **method**
end if
next
end sub
Le problème que je vais avoir est d'appeler la méthode. Cela ne fonctionne pas:
Example(myPlaceholder, addressof MyRuntimeHandler)
Ajouter des informations plus pertinentes pour soutenir votre réponse au lieu d'un seul doublure .... – bonCodigo