Last post Feb 16, 2010 09:05 AM by chickflickssuck
Feb 11, 2010 05:45 AM|mfarooqw|LINK
Hi, What is the difference b/w Delegates and Events. I have little bit confusion. Where delegates are used, and when we have to used delegates. Can, you give some examples(both delebates and events) in vb.net.
Feb 11, 2010 07:27 AM|qwe123kids|LINK
There No keyword Delegate While using event
Event can decalred in Inteface But delegate is Not.
event is Class specific and delegate can used who ever can Acess it..
chk the abov elink
Feb 11, 2010 10:24 AM|atconway|LINK
Check out some of the following links with detailed descriptions and examples in VB.NET:
Visual Basic Language Concepts - Events and Delegates:
VB.NET School - Delegates and Events:
Event Handling in VB.NET:
Hope this helps!
Feb 15, 2010 05:15 AM|pauldaniel|LINK
Events are the actions of the system on user manipulations (e.g. mouse clicks, key press, timer etc.) or any event triggered by the program.
Delegate is type which holds the method(s) reference in an object. It is also refered as a type safe function pointers.
Feb 16, 2010 04:54 AM|Vijaya.A|LINK
Hi delegates and events with example
Feb 16, 2010 04:58 AM|manoj0682|LINK
this link might help you
Feb 16, 2010 09:05 AM|chickflickssuck|LINK
For a dummy explination, as I would be one who requires such an answer:
(this is more "in concept" that exact code syntax, but I will do my best with the syntax as well)
a delegate is a reference to a method. in other words, you could have a function, but instead of having to call the function by its name every time you want to use it, you could assign that function to an object, or... a variable.
Delegate Function MyDelegate(ByVal p As Integer, ByVal q As Integer) As Integer
Public Sub TestSomething()
Dim arithMethod As New MyDelegate(AddressOf Add)
Dim res As Integer = arithMethod(3, 4)
Console.WriteLine("The result of your operation is: " & res)
Function Add(ByVal a As Integer, ByVal b As Integer) As Integer
Return a + b
An event on the other hand, is something that your program (or possibly even the .net platform) does, or can do.. that you have the ability to be notified about. such as the value of a dropdown list changing, it has an event "selected value changed".
hopefully i didnt just make a bigger mess, and this helps clear things up :)