De una forma u otra necesito vincular groupID (y otro entero) al botón que estoy agregando dinámicamente ... ¿alguna idea?AddressOf con el parámetro
Lo que puedo hacer;
AddHandler mybutton.Click, AddressOf PrintMessage
Private Sub PrintMessage(ByVal sender As System.Object, ByVal e As System.EventArgs)
MessageBox.Show("Dynamic event happened!")
End Sub
Lo que no puedo hacer, pero quiero;
AddHandler mybutton.Click, AddressOf PrintMessage(groupID)
Private Sub PrintMessage(ByVal groupID as Integer)
MessageBox.Show("Dynamic event happened!" & groupID .tostring)
End Sub
Ver http://stackoverflow.com/questions/13401246/how-to-pass-parameters-in-addhandler-using-vb-net –