troubleshooting Question

Adding a custom event in a VB.NET custom control

Avatar of stev0931
stev0931 asked on
Visual Basic.NET
6 Comments3 Solutions446 ViewsLast Modified:
I am trying to add an event in a VB.NET custom control and don't know how to do it.  I know I need something like this:

Class C1
  Public Custom Event MyEvent As EventHandler
    AddHandler(ByVal d As EventHandler)
    End AddHandler

    RemoveHandler(ByVal d As EventHandler)
    End RemoveHandler

    RaiseEvent(ByVal o As Sender, ByVal e As EventArgs)
    End RaiseEvent
  End Event
End Class

but I don't know what to do from there.  Another thing I'd like to do, if possible, is to make the event so that it is the default one created when you double-click on the control in a forms designer.

Any help would be greatly appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros