d'erreur:WithEvents génériques
'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints
Contexte:
Public Class Tadpole(Of T As IVisibleChanged, P As IVisibleChanged)
Private WithEvents _Tad As T ' ERROR '
Private WithEvents _Pole As P ' ERROR '
Public Property Tad() As T ...
Public Property Pole() As P ...
End Class
''' IVisibleChanged '''
Public Interface IVisibleChanged
Property Visible() As Boolean
Event VisibleChanged As EventHandler
End Interface
Solution:
a. Utilisez AddHandler
pour gérer les événements définis dans une structure.
EDIT
b. utiliser Private WithEvents _Tad As
IVisibleChanged
(M.A. Hanin)
c. ?
la syntaxe est OK, merci! – serhio