Imports System
Module Events
Friend WithEvents button As Button
Public Sub Main()
button = New Button()
button.Click
End Sub
Public Sub Button_OnClick Handles button.OnClick
Console.WriteLine("Button Clicked")
End Sub
End Module
Public Class Button
Public Event OnClick
Public Sub Click()
RaiseEvent OnClick()
End Sub
End Class
|