?
Solved

event registration

Posted on 2013-10-30
2
Medium Priority
?
291 Views
Last Modified: 2013-10-31
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.
0
Comment
Question by:jdcoburn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 2000 total points
ID: 39611299
>>is there any harm in having the same event be registered multiple times
Apart from the obvious one - for the one event many pieces of code will be run.

For the other question about the binding being dropped - I've no idea why you experience that.
0
 

Author Closing Comment

by:jdcoburn
ID: 39613979
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question