Exforsys
+ Reply to Thread
Results 1 to 2 of 2

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 ...

  1. #1
    dpatfield66 is offline Software Engineer Array
    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?


  2. #2
    Eyal.Albert is offline Junior Member Array
    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.


Latest Article

Network Security Risk Assessment and Measurement

Read More...