Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Panel1.Controls.Clear()
Dim patiekalai = New Button()
Panel1.Controls.Add(patiekalai)
patiekalai.Location = New Point(0, 0)
patiekalai.Size = New Size(80, 50)
patiekalai.Image = Image.FromFile("../M/Karštieji patiekalai.jpg")
Private Sub Patiekalai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Patiekalai.Click
I get error while trying to add a Click event handler for my dynamically created button patiekalai:
Handles clause requires a WithEvents variable defined in the containing type or one of its base types.