Skip to content

Instantly share code, notes, and snippets.

@ebenito
Last active March 5, 2019 08:31
Show Gist options
  • Save ebenito/21816c3681d3adf16140629e32d2bd17 to your computer and use it in GitHub Desktop.
Save ebenito/21816c3681d3adf16140629e32d2bd17 to your computer and use it in GitHub Desktop.
Capturar un evento para cualquier objeto de cierto tipo (aquí TextBox)
For Each c As Object In Form1.Controls
If c.GetType Is GetType(TextBox) Then
AddHandler DirectCast(c, TextBox).TextChanged, AddressOf CamposForm_TextChanged
End If
Next
Sub CamposForm_TextChanged(ByVal sender As TextBox, ByVal e As System.EventArgs)
CamposCambiados.Value = CamposCambiados.Value & IIf(CamposCambiados.Value <> "", ", " & sender.ID, sender.ID)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment