Hi All,

I can create a Button during runtime, but the click event doesn't execute.
Here's the code;

VB Code:
  1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Dim button As New Button
  3.         With button
  4.             .BackColor = Color.ForestGreen
  5.             .Height = 25
  6.             .Width = 75
  7.             .Location = New Point(10, 10)
  8.             .Text = "Hello"
  9.             AddHandler button.Click, AddressOf button_Click
  10.  
  11.         End With
  12.         Controls.Add(button)
  13.     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