Define your own Event and raise it : RaiseEvent « Event « VB.Net Tutorial






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








11.4.RaiseEvent
11.4.1.Raise your own event
11.4.2.Define your own Event and raise it