Jump to content
Xtreme .Net Talk

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


Recommended Posts

Guest cgchris99
Posted

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

  • *Gurus*
Posted

How about a generic handler for all textboxes...

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...