Adjust Class for every Textbox on a form? Need additional function.

  • Thread starter Thread starter cgchris99
  • Start date Start date
C

cgchris99

Guest
I have a form that has a bunch of textboxes and checkboxes. I need to know whenever any field gets changed on this form.
Is there a way to inherit some sort of class for this? Or do I have to write this piece of code for every field/checkbox/combo, etc.

RecordChanged=True

Thanks for any advice
 
How about a generic handler for all textboxes...
Visual Basic:
Private Sub AnyTextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
  Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged, TextBox4.TextChanged

  Dim myTextBox As TextBox

  myTextBox = CType(sender, TextBox)
  'do something with myTextBox
End Sub
 
Back
Top