Link to home
Start Free TrialLog in
Avatar of jdcoburn
jdcoburn

asked on

event registration

hi - I have a winform application and .net 4, using VS2010. the application uses a tab control to organize itself. all the code is written around which tab you're on and each tab runs a method as it is loads. the load method queries a database and draws the appropriate number of controls as it loads. since some of the controls are dependent on the query, I have to create them on entry and refer to them in the code using winhandles. as part of the process I also register an event for the controls. so, my question is two fold - is there any harm in having the same event be registered multiple times (each time the tab is invoked?); and after an indeterminate length of time, the binding between the event and the event handler seems to drop. any idea why?
should I be disposing of the controls as I leave the tab?
thanks.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland 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
Avatar of jdcoburn
jdcoburn

ASKER

ok - I think you answered the question I should have asked - each time the event is registered it creates a new copy which results in multiple passes through the code.