Differnece between Events and Delegates

G

Gopal Prabhakaran

Dear Guys

Pls tell me the difference between Events and Delegates..

Thanx
Gopal Prabhakaran
 
D

Daniel O'Connell

There isn't much. A delegate is a wrapper around a method call, an event is
basically a special property that contains a delegate with protection
provided by the language. Events are accessed through a set of property
methods(public add_EventName(Delegate d), public remove_EventName(Delegate
d), and sometimes a protected raise_EventName(not sure of the sig, think its
just EventArgs e)) which allows you to ensure that callers outside of your
class don't raise the event or don't clear all the event listeners for
example, while still allowing them to add and remove their own handlers.
 
G

Gaurav Khanna [C# MVP]

Hi!

These should help you:

http://msdn.microsoft.com/library/en-us/csref/html/vcwlkdelegatestutorial.asp
http://msdn.microsoft.com/library/en-us/csref/html/vcwlkEventsTutorial.asp
http://www.devmail.net/help/devmail.usingevents.html

--
Regards,
Kumar Gaurav Khanna
-----------------------------------------------------------------
Microsoft MVP - C#/.NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
Bangalore .NET Users' Group
http://groups.msn.com/bdotnet/
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top