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

A

Andreas Klemt

Hello,

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

Thanks,
Andreas
 
J

James J. Foster

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.
 
A

Andreas Klemt

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

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top