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
来处理结构中定义的事件。
编辑
b。使用Private WithEvents _Tad As
IVisibleChanged
(M.A.Hanin)
c。 ?
语法正常,谢谢! – serhio 2010-03-09 12:00:39