Difference between "Protected WithEvents myClassName" And "Protected myClassName" ?

  • Thread starter Thread starter Andreas Klemt
  • Start date Start date
A

Andreas Klemt

Hello,

what is the difference between
a) Protected WithEvents myClassName
b) Protected myClassName

Thanks,
Andreas
 
WithEvents is a VB.NET keyword to indicate that the object you are declaring
can raise events, and you want to support the ability to respond to those
events.
 
Hello James,
does this mean, when I have a UserControl Class like this

Protected WithEvents ctlID As myUserControlClass

that any Events in my UserControlClass like Button.Click will be
automatically bubbled up to the parent class?

What would happen when I only do this
Protected ctlID As myUserControlClass

Thanks you for any help!!
Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top