title: VB.Net - Add Handler to object of unknown type?
body: <p>I am trying to create a Sub that can take an object and add a load of event handlers for it, but the object can be any one of N types that all have these events. How can I do this? If I just have it as an Object as below AddHandler complains that the event does not exist for Object.</p>
  
  <p>Can this be done?</p>
  
  <pre><code>Sub addHandlers(ByVal inputObject as object)
      AddHandler inputObject.MouseDown, AddressOf HandleClick
      AddHandler inputObject.MouseUp, AddressOf HandleMouseUp
  End Sub
  </code></pre>
  
  <p><strong>EDIT:</strong> Each of these objects is an instance of a class that inherits a different class (usually a control) that already has these events.</p>
  
  <p>Thanks for any help,<br>
  Sam.</p>