dim btn as new button
btn.name = "ButtonName"
btn.text = "ButtonText"
btn.left = 100
btn.top = 100
me.controls.add(btn)
addhandler btn.cli, addressof BtnEvent
...
public sub BtnEvent
end sub
you will need to change the section below to make sure your button is visible to the use each time else the next button to be drawn will overwrite the previous
btn.left = 100
btn.top = 100