tags:

views:

149

answers:

4

Possible Duplicate:
Can someone distill into proper English what a delegate is?

Hi All, can somebody explain the use of delegate..I know that it is used to invoke methods at run time...but exactly what does it mean..can somebody explain it with some simple example, which will help a newcomer to understand delegate better

A: 

This is a dupe. Refer here StackOverflow

Yogendra
thnx for d link.
Learning.net
A: 

It sounds like you've already got it (partly, anyway). A delegate is an object that refers to a method, and can execute it. Often it refers to a method on another object.

Delegates are very useful in event-driven programming. For example: A delegate can be used so that a button click on your form calls a function on some other object in your system which might carry out some other series of actions. Delegates are also useful in Inversion of Control programming.

FrustratedWithFormsDesigner
A: 

Good explanations there. One thing to consider, a delegate is actually an object.

Curtis White
+1  A: 

Chris Sells wrote the best article that I have ever read regarding delegates and events. Give this a read: http://www.sellsbrothers.com/writing/delegates.htm

JMarsch
That's a very well-written page.
FrustratedWithFormsDesigner