These solutions only work if the executable code is accessible to the class (class A), which may not be the case if you are creating a library. If the control (s) that must execute the same code is in a class that will be created in another class (class B), and the instatiating class is the one where the code to be executed will be defined, then you can do this
Class A
Public Event ListDoubleClickOrClick() Private Sub HandleListDoubleClickOrClick(sender As Object, e As System.EventArgs) Handles listObject.DoubleClick, listObject.Click RaiseEvent ListDoubleClickOrClick() End Sub
Class B
private sub theCodeToBeExecuted() end sub dim objClassA as A AddHandler objClassA.ListDoubleClickOrClick, AddressOf theCodeToBeExecuted
DJDave
source share