Hi All,
I can create a Button during runtime, but the click event doesn't execute.
Here's the code;
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim button As New Button With button .BackColor = Color.ForestGreen .Height = 25 .Width = 75 .Location = New Point(10, 10) .Text = "Hello" AddHandler button.Click, AddressOf button_Click End With Controls.Add(button) End Sub
This line gives me an error, button_click is not declared
AddHandler button.Click, AddressOf button_Click
How can I make, after creating a button during runtime, that it will execute
after clicking the button.
Thanks in advance,
sparrow1





Reply With Quote