How to direct all events from 1 type of control to the same handler? {RESOLVED}
How do I direct all the events of comboBox_change to one single handler.
I need to do this because I have a set of runtime created controls, however, the numbers created is only decided during runtime.
Re: How to direct all events from 1 type of control to the same handler?
Quote:
Originally posted by weiyen
How do I direct all the events of comboBox_change to one single handler.
I need to do this because I have a set of runtime created controls, however, the numbers created is only decided during runtime.
Usually you would use an array of controls. However I know that this is not possible with the same ease as in VB6.
The other option would be to write a function like
VB Code:
Function AllClicks(number1, number2)
'Do something
AllClicks = something 'to pass a value back if required
End Function
and simply put
VB Code:
result = AllClicks(Num1, Num1)
and so forth for each type of event you wish to handle.
May I ask what the disired result is?
Code:
IIF(Answer=Yes, "What's the disired result?", "...")