Look at the following example code. A Form has a Button on it. The button when clicked, create a new form, attaches a handler to the Load event and then displays the new form.
The handler is fired and a message box with the new forms name is displayed;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FormX As New Form
FormX.Name = "SomeForm"
AddHandler FormX.Load, AddressOf SomeHandlerFunction
FormX.Show()
End Sub
Public Sub SomeHandlerFunction(ByVal sender As System.Object, ByVal e As System.EventArgs)
If TypeOf (sender) Is Form Then
Dim theNewForm As Form = CType(sender, Form)
MsgBox(theNewForm.Name + " was loaded.")
End If
End Sub