How do I link up a button click event between a class and a module automatically?
- by CowKingDeluxe
I have this code (which doesn't work):
Public Class Form1
End Class
Public Module test1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form1.Button1.Click
MsgBox("HI")
End Sub
End Module
I know I could handle the button click event in Form1, and then call a function in test1, but I would like to handle the button click event directly in the test1 module. Is there a way to automatically send UI events from the Form1 class to another module?