When one extends a class, how is the proper way of setting code to be executed upon some event of the base class?
Should one handle the base class event this way:
Public Class Class2 Inherits Class1 Private Sub MyBase_MyEvent(sender as object, e as eventargs) Handles MyBase.MyEvent ' do stuff here End Sub End Class
Or should one override the event caller sub?
Public Class Class2 Inherits Class1 Protected Overrides Sub OnMyEvent(e as EventArgs) MyBase.OnMyEvent(e) ' do stuff here End Sub End Class
Thank you very much