|
-
Jan 1st, 2004, 09:26 PM
#1
Thread Starter
Junior Member
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.
Last edited by weiyen; Jan 14th, 2004 at 08:11 PM.
-
Jan 7th, 2004, 04:34 AM
#2
Addicted Member
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.
Regards
BrianB
-------------------------------
-
Jan 14th, 2004, 11:00 AM
#3
Fanatic Member
Re: How to direct all events from 1 type of control to the same handler?
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?", "...")
-
Jan 14th, 2004, 08:13 PM
#4
Thread Starter
Junior Member
-
Jan 14th, 2004, 08:13 PM
#5
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|