You use AddHandler
and AddressOf
like this:
Dim MyButton as New Button()
MyButton.Name = "MyButton"
AddHandler MyButton.Click, AddressOf MyButton_Click
There is more info here in the MSDN documentation:
- How to: Add an Event Handler Using Code