locked
Address of RRS feed

  • Question

  • User1655374113 posted

    Hello,

    What is the exact benefit of using Address of in coding ?

    TIA

    Monday, June 3, 2013 9:32 AM

Answers

  • User-851967432 posted

    Wiring events to methods a.k.a. delegate

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 3, 2013 10:09 AM
  • User-166373564 posted

    Hi ramll

    What is the exact benefit of using Address of in coding ?

    As we know, AddressOf creates a procedure delegate instance that references the specific procedure,

    The AddressOf operator creates a function delegate that points to the function specified by procedurename. When the specified procedure is an instance method then the function delegate refers to both the instance and the method. Then, when the function delegate is invoked the specified method of the specified instance is called.

    hope it helps you,

    With regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 10, 2013 2:22 AM

All replies

  • User-851967432 posted

    Wiring events to methods a.k.a. delegate

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 3, 2013 10:09 AM
  • User-1618234021 posted

    Using Visual Basic, to bind the methods with dynamic controls using delegates. See the following example:

    dim b as new Button()
    b.Text = "New Button"
    AddHandler b.Click, AddressOf b_Click
    
    'where b_click will be defined as 
    
    sub b_Click(ByVal sender as Object, ByVal e as EventArg)
    
    End Sub



    Monday, June 3, 2013 10:13 AM
  • User1655374113 posted

    AddHandler b.Click, AddressOf b_Click
    
    'where b_click will be defined as
    
    sub b_Click(ByVal sender as Object, ByVal e as EventArg)
    
    End Sub

    Hi,

    That button click method is not firing..

    http://forums.asp.net/p/1911317/5412818.aspx/1?p=True&t=635058517534636652

    Monday, June 3, 2013 10:23 AM
  • User-166373564 posted

    Hi ramll

    What is the exact benefit of using Address of in coding ?

    As we know, AddressOf creates a procedure delegate instance that references the specific procedure,

    The AddressOf operator creates a function delegate that points to the function specified by procedurename. When the specified procedure is an instance method then the function delegate refers to both the instance and the method. Then, when the function delegate is invoked the specified method of the specified instance is called.

    hope it helps you,

    With regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 10, 2013 2:22 AM