|
|||
|
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? |
| Sponsored Links |
|
|||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|