AddressOf with parameter

后端 未结 8 675
误落风尘
误落风尘 2021-01-07 23:33

One way or another I need to link groupID (and one other integer) to the button I am dynamically adding.. any ideas?

What I can do;

AddHandler mybutt         


        
8条回答
  •  死守一世寂寞
    2021-01-08 00:26

    The below worked for me:

    Dim bStart = New Button With {.Text = "START"}
    AddHandler bStart.Click, Function(sender, e) TriggerProcess(any Long value)
    
    
    Private Function TriggerProcess(ByVal paramName As Long) As Boolean
     ' any processing logic
     Return True
    End Function
    

提交回复
热议问题