Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyButton As New Button()
With MyButton
.Location = New Point(12, 12)
.Size = New Size(175, 80)
.TabIndex = 0
.Text = "Click Me"
Controls.Add(MyButton)
End With
AddHandler MyButton.Click, AddressOf MyButton_Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("1111111111111")
End Sub
Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) '(ByVal obj As Object, ByVal e As EventArgs)
MsgBox("22222222222222")
End Sub
End Class