What is the difference between raiseevent and just calling a function?

What is the difference between raiseevent and just calling a function?
HepenAsked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
0
 
Shiju SasidharanAssoc Project ManagerCommented:

Raiseevent simply trigers amn event in client application.
suppose u have a class with 3 events say event1, event2 and event3 and
 to invoke events in proper time in ur class we use RaiseEvent
and when u create object of this class in a client application, we can make use of these events in the application
that is u need to declare object using WithEvents key word
0
 
Shiju SasidharanAssoc Project ManagerCommented:
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
HepenAuthor Commented:
I see, so if I have one class and I don't really need to share a method via event I can just call the method instead of attatching an event to it?

Events are only if you want to share that method amongst other classes?
0
 
Shiju SasidharanAssoc Project ManagerCommented:


Events are used to inform that particalar situation has arrived or incident has occurred, or some property has been changed.
0
 
Shiju SasidharanAssoc Project ManagerCommented:
To share method amongst other classes u can use Shared access modifier?

or use Public modifier (Need to create object of that class to access public method)
0
 
Shiju SasidharanAssoc Project ManagerCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.