I'm not a pro, by here's my explanation (hope it helps):
How to you call another function without knowing its name? Just like you receive a variable ByRef without its name, you can do that with subs & functions. They are "safe" function pointers, or delegates.
If you want to create a delegate for a function, do this:
VB.NET:
Public Delegate Sub MyDelegate(ByVal arg1 As Integer)
Delegates are also used by events. When an event is declared VB.Net creates a hidden delegate by same signature. It's the invocation list of this delegate that all subscribed instance methods are added to or removed from through WithEvents/AddHandler/RemoveHandler, and all these methods are called (invoked) in succession when the event is raised.
Hi Friends, Thank you very much for your support.The approach is simple and at the same time effective to learn about delegates.Thanking you all for the help. have a great dayRegardschandru
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.