Handling buttons events from a module.

Jun 8 2006 7:49 PM
Hello, I was wondering there wasy any way to use button events outside of the form that holds the button (in this case, inside a module). For example, if I had a window called Form1 which contained a button called Button1, and I wanted to use the following inside a module: Private Sub Button1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Button1.Click ' Button handling stuff here. End Sub ...I would receive the error: "Handles clause requires a WithEvents variable defined in the containing type or one of its base types." (Which, as I'm relatively new to Visual Basic, is basically gibberish to me. =P) Am I to assume then that button events can only be put in the form that contains them? Or is there some way to reference events for a button on another form? Thanks very much in advance. =)