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
 
Back
Top