Hi,
You are trying to handle the event after you have initiated it.
try changing the btn click to this:
Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ex As New Executor()
AddHandler ex.Change, New Executor.ExecutorChangeEventHandler(AddressOf executor_Change)
ex.TryChange()
End Sub
The other issue you have (possibly) is that you are instantiating a new instance of Executor in the button click. By the time the event is called the executor object will not be avaliable to reference back as it was only in the scope of the button click. You should consider moving the ex (Executor) to a private declaration at class level so that it is avalaible for the lifetime of the class object.
i.e.
private ex as Executor
public sub new()
ex = new Executor
AddHandler ex.Change, New Executor.ExecutorChangeEventHandler(AddressOf executor_Change)
end sub
Private Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
ex.TryChange()
End Sub