1 Imports System.Windows.Forms
8 Public WithEvents b1 As Button
9 Public WithEvents b2 As Button
11 Public Sub b1_onClick (sender As Object, e as System.EventArgs)
12 Console.WriteLine ("b1 clicked")
15 Public Sub b2_onClick (sender As Object, e as System.EventArgs)
16 Console.WriteLine ("b2 clicked")
21 b1.Location = New Point(100, 10)
23 AddHandler b1.Click, AddressOf b1_onClick
26 b2.Location = New Point(100, 60)
28 AddHandler b2.Click, AddressOf b2_onClick