K
Ken Kast
What I'm trying to do is find a way to determine at run time if a particular
event handler in a UserControl has been defined. Here's a snippet of code:
Public Event Button_Click As EventHandler
Public WriteOnly Property ButtonClick() As System.EventHandler
Set(ByVal Value As System.EventHandler)
If Not Value Is Nothing Then
AddHandler Me.Button_Click, Value
Me.HasButtonClick = True
End If
Console.WriteLine("Handler exists=" & Not (Me.Events(Me.Button_ClickEvent)
Is Nothing))
End Set
The write statement prints out False, but the handler is in fact installed,
i.e., the event is handled by the event handler passed in is executed. Why
doesn't the Events list show the handler?
Ken
event handler in a UserControl has been defined. Here's a snippet of code:
Public Event Button_Click As EventHandler
Public WriteOnly Property ButtonClick() As System.EventHandler
Set(ByVal Value As System.EventHandler)
If Not Value Is Nothing Then
AddHandler Me.Button_Click, Value
Me.HasButtonClick = True
End If
Console.WriteLine("Handler exists=" & Not (Me.Events(Me.Button_ClickEvent)
Is Nothing))
End Set
The write statement prints out False, but the handler is in fact installed,
i.e., the event is handled by the event handler passed in is executed. Why
doesn't the Events list show the handler?
Ken