Does WithEvents
in Visual Basic keep its EventHandler
s when changing the reference to the object?
Say I have declared a button, firing events:
Private WithEvents _MyButton
Now I am subscribing to an event handler:
Private Sub _MyButton_Click() Handles _MyButton.Click
' Here I DoClick()
End Sub
Will the DoClick()
function be still called when I change the instance of the button object like shown below?
_MyButton = New Button()