3
오류 :일반에서 WithEvents
'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints
배경 :
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
해결 방법 :
가. AddHandler
을 사용하여 구조에 정의 된 이벤트를 처리하십시오.
edit
b. Private WithEvents _Tad As
IVisibleChanged
(M.A. Hanin)
c를 사용하십시오. ?
구문은 정상입니다. 감사합니다! – serhio