I am creating some buttons dynamically in vb.net, but i am not able to create the click event handler.
This is my code:
dim b(10)
dim x=0
b(x) = New Button
b(x).width = 100
b(x).height = 25
b(x).location = New Point(500, pos + 24)
b(x).visible = True
b(x).text = "Remove"
AddHandler b(x).Click, AddressOf remove_click
I am getting the following error when i try to compile 'Click' is not an event of 'Object'.
Public Sub remove_click(sender As Object, e As EventArgs)
' onclick code
End Sub