Click here to Skip to main content
15,867,756 members
Articles / Programming Languages / Visual Basic 10
Alternative
Tip/Trick

Multiple Event Handling for the Lazy Ones

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
25 May 2011CPOL 6.1K   1   1
why not just create a custom handler for all the textboxes? addhandler textbox1.textchanged, addressof textchangedhandler addhandler textbox2.textchanged, addressof textchangedhandler .... 'add additional textbox handlers .... addhandler textbox7.textchanged, addressof...
why not just create a custom handler for all the textboxes?

VB
addhandler textbox1.textchanged, addressof textchangedhandler
addhandler textbox2.textchanged, addressof textchangedhandler
....
'add additional textbox handlers
....
addhandler textbox7.textchanged, addressof textchangedhandler


For the customer handling routine

VB
private sub TextchangedHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
 '....
 'Do sub code
 '....
end sub

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMore typing :P Pin
Anshul R25-May-11 4:41
Anshul R25-May-11 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.