PDA

Click to See Complete Forum and Search --> : How to direct all events from 1 type of control to the same handler? {RESOLVED}


weiyen
Jan 1st, 2004, 08:26 PM
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.

BrianB
Jan 7th, 2004, 03:34 AM
How about creating enough ComboBoxes to do the job first, and setting the visible property to True or False as necessary.

To save duplication of code you can make a sub routine and refer all the change events to this.

Matt_T_hat
Jan 14th, 2004, 10:00 AM
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 Function AllClicks(number1, number2)
'Do something
AllClicks = something 'to pass a value back if required
End Function
and simply put result = AllClicks(Num1, Num1) and so forth for each type of event you wish to handle.

May I ask what the disired result is?

IIF(Answer=Yes, "What's the disired result?", "...")

weiyen
Jan 14th, 2004, 07:13 PM
I've gotten the solution..
Thanks

http://www.vbforums.com/showthread.php?s=&threadid=273307

weiyen
Jan 14th, 2004, 07:13 PM
I've gotten the solution..
Thanks All

http://www.vbforums.com/showthread.php?s=&threadid=273307