Skip to content

Instantly share code, notes, and snippets.

@OnSive
Last active February 9, 2021 16:07
Show Gist options
  • Select an option

  • Save OnSive/11aa56142fb33f2b049ea85a002ddcda to your computer and use it in GitHub Desktop.

Select an option

Save OnSive/11aa56142fb33f2b049ea85a002ddcda to your computer and use it in GitHub Desktop.
[Custom event] A full custom event #Event
Public Class FooBar
Public Delegate Sub FooBarChanged(sender As Object, e As FooBarEventArgs)
Public Event OnFooBarChange As FooBarChanged
Private Sub RaiseEvent()
RaiseEvent OnFooBarChange(Me, new FooBarEventArgs(123))
End Sub
End Class
Public Class FooBarEventArgs
Inherits EventArgs
Public ReadOnly Property MyProperty As Integer
Friend Sub New(ByVal MyProperty As Integer)
MyBase.New()
Me.MyProperty = MyProperty
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment