Groups | Blog | Home
all groups > vb.net > january 2008 >

vb.net : Is there difference betweein using AddressOf and Delegate?


Rich
1/7/2008 11:29:06 AM
Is there a difference between AddressOf and Delegate for assiging a
function/Sub to an event?

Add_Handler txt1.Click AddressOf WhatColorFont

or

Private Sub Delegate WhatColorFont()
....

Is there any difference between these or is it just a one or the other thing?

Thanks,
rowe_newsgroups
1/7/2008 12:11:35 PM
[quoted text, click to view]

You use AddressOf to implicitly create the delegate instead of doing
it by hand. I would recommend just using AddressOf for simplicities
sake, though it doesn't really matter.

Thanks,

Rich
1/7/2008 12:51:00 PM
Thank you. That really helps to demystify delegates. I think I have it
straight now.



[quoted text, click to view]
AddThis Social Bookmark Button