I have a form "frmShow" that I created at run-time.
How do I use event handlers without being able to create the code in the form?
Printable View
I have a form "frmShow" that I created at run-time.
How do I use event handlers without being able to create the code in the form?
You can use the AddHandler statement to attach an event to an appropriate delegate sub.
or this
VB Code:
WithEvents f As New Form() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click f.Show() End Sub Sub x(ByVal sender As Object, ByVal e As EventArgs) Handles f.Load f.Text = "the quick brown monkey jumps over the lazy dog." End Sub
:wave: Thank you both.:wave: