fork download
  1. Public Class Foo
  2. Public Event Click As EventHandler
  3. Public Sub Fire()
  4. RaiseEvent Click(Me, EventArgs.Empty)
  5. End Sub
  6. End Class
  7.  
  8. Public Class Bar
  9. Private WithEvents foo1 As New Foo
  10. Sub New()
  11. foo1.Fire()
  12. End Sub
  13. Private Sub foo1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles foo1.Click
  14. Console.WriteLine("Click")
  15. End Sub
  16. End Class
  17.  
  18. Module Program
  19. Sub Main()
  20. Dim bar1 As New Bar
  21. End Sub
  22. End Module
Success #stdin #stdout 0.05s 13160KB
stdin
Standard input is empty
stdout
Standard output is empty