hello plzz help me out

how to write the event for a button or anything created at runtime


whoever bothers to help ,thanks to them in advance

Recommended Answers

All 2 Replies

First you would write the procedure that you want to execute when the button is clicked.

Protected sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
     'put your code here
end sub

After the button is created you use the addhandler to add the event.

AddHandler button1.clicked, addressof button1_click

there are many event for controls. the simple one is clicked. double click on your control (ex button) and the event will shown.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      ' add code here
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.