C
cgchris99
Guest
I have about 100 textboxes on a form and they are in various tabs.
I have had to add the following handlers to perform some code that I want on these events.
Is there a way to modify the existing Textbox class to include these changes so I don't have to add this code 100 times for each of the textboxes on the form?
You will notice the Procedure for TextBoxChanged is the same for every textbox on the form and so is TextBoxValidated, TextboxMouseDown, etc.
Thanks for any help
AddHandler txtTextBox1.TextChanged, AddressOf TextBoxChanged
AddHandler txtTextBox1.Validated, AddressOf TextBoxValidated
AddHandler txtTextBox1.MouseDown, AddressOf TextBoxMouseDown
AddHandler txtTextBox1.Leave, AddressOf TextBoxLeave
AddHandler txtTextBox1.KeyPress, AddressOf TextBoxKeypress
AddHandler txtTextBox2.TextChanged, AddressOf TextBoxChanged
AddHandler txtTextBox2.Validated, AddressOf TextBoxValidated
AddHandler txtTextBox2.MouseDown, AddressOf TextBoxMouseDown
AddHandler txtTextBox2.Leave, AddressOf TextBoxLeave
AddHandler txtTextBox2.KeyPress, AddressOf TextBoxKeypress
I have had to add the following handlers to perform some code that I want on these events.
Is there a way to modify the existing Textbox class to include these changes so I don't have to add this code 100 times for each of the textboxes on the form?
You will notice the Procedure for TextBoxChanged is the same for every textbox on the form and so is TextBoxValidated, TextboxMouseDown, etc.
Thanks for any help
AddHandler txtTextBox1.TextChanged, AddressOf TextBoxChanged
AddHandler txtTextBox1.Validated, AddressOf TextBoxValidated
AddHandler txtTextBox1.MouseDown, AddressOf TextBoxMouseDown
AddHandler txtTextBox1.Leave, AddressOf TextBoxLeave
AddHandler txtTextBox1.KeyPress, AddressOf TextBoxKeypress
AddHandler txtTextBox2.TextChanged, AddressOf TextBoxChanged
AddHandler txtTextBox2.Validated, AddressOf TextBoxValidated
AddHandler txtTextBox2.MouseDown, AddressOf TextBoxMouseDown
AddHandler txtTextBox2.Leave, AddressOf TextBoxLeave
AddHandler txtTextBox2.KeyPress, AddressOf TextBoxKeypress