
- Forum
- Programming Talk
- Microsoft .NET
- Controls and Event Handlers
Controls and Event Handlers
This is a discussion on Controls and Event Handlers within the Microsoft .NET forums, part of the Programming Talk category; I know that in an even I use the Handles control.click (for example) and then when the user clicks on ...
-
05-13-2008, 12:56 PM #1
- Join Date
- May 2008
- Location
- Illinois
- Answers
- 1
Controls and Event Handlers
I know that in an even I use the Handles control.click (for example) and then when the user clicks on the control, the code executes.
But what if I have 50 comboboxes that I want to execute code on when the uses clicks them? Rather than add every single combobox at the event handler, how could I effectively tell the program to execute this code during the click event for ALL comboboxes?
-
01-18-2009, 07:43 AM #2
- Join Date
- Jan 2009
- Answers
- 1
You have to register every control to that event.
The only short cut i can offer you is to run in a loop on every control on the form (and if you know that the controls are actually are placed in other controls like panel or tab control run recursively on every control that holds them) and register if the control is from the right type.

Reply With Quote





