If you want your control to behave like the standard controls (i.e allow multiple events to be routed to a single event handler) then you should really follow this model.
In practice it is easy enough to do - if you require no extra information to be passed to the event handler then just use System.EventHandler as an event type
Public somethingHappened As System.EventHandler
Protected Overridable Sub OnSomething()
somethingHappened(Me, New System.EventArgs)
End Sub
putting the raising of the event in it's own function (On.......) makes it easier to raise from multiple places and cleaner for code that inherits your control.
If you need to pass custom information then create a class that derives from System.EventArgs and add any relevant properties required. Then create your own delegate for the event.
Public Class MyEventArgs
Inherits EventArgs
Private _OldColour, _NewColour As Color
Sub New(ByVal oldColour As Color, ByVal newColour As Color)
_OldColour = oldColour
_NewColour = newColour
End Sub
Public ReadOnly Property NewColour() As Color
Get
Return _NewColour
End Get
End Property
Public ReadOnly Property OldColour() As Color
Get
Return _OldColour
End Get
End Property
End Class
'to use the above class
Public Delegate Sub ColourChangedEvent(ByVal sender As Object, ByVal e As MyEventArgs)
Public ColourChanged As ColourChangedEvent
Protected Overridable Sub OnColourChanged()
ColourChanged(Me, new MyEventArgs(color.Red, color.Black)
End Sub