Is there difference betweein using AddressOf and Delegate?

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

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,
Rich
 
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,
Rich

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,

Seth Rowe [MVP]
 
Back
Top