Link to home
Start Free TrialLog in
Avatar of Phyllax
Phyllax

asked on

assign single event handler code to events of multiple control fields

I have multiple e.g. Text field controls on a Windows form (VB6).
Instead of coding always the same routine for e.g. TextChanged events of each of the fileds I like to assign those events to the same coding instance.
The "sender" System.Object parameter should allow me to handle any differences in the singlke code insatnces related to the various Text control elements.
I assume that such an approach should also be able to handle the different "e" System.EventArgs in a single coding instance.

My problem is that I don't know how to specify the individual event handlers for each of the control fielsd with assignment to the single coding instance.

I assume that this is a stupid questing of a novice to Studio 2010 / VB6 programming.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Add a EventHandler and assign it to any control as shown below:
 User generated image
...you are NOT coding in VB6 if you have VS2010.  You would be using VB.Net then!  =)

*VB6 is a very different beast than VB.Net.