[2005] A question about passing Delegates to an object (maybe)
Hi,
I've been studying about delegates and there's a problem I can't quite get my head around, which is probably an application for them.
Situation
--------
You have a code object that has a reference to a control, say a tool strip split button.
You're using that object as *I guess* a wrapper class, to help simplify the interaction with the splitbutton.
To add a new item to the list, you want to pass to the object the new item's text and event handler. No problem passing a string variable for the text, but to the question in hand...
"How do you pass the event handler?" It could be any method, i.e. different items may have different handlers, but will be added in the code object as something like:
Code:
AddHandler newItem.Click, AddressOf handler
where handler is the argument .
I'm really interested to know how to do this as it's been puzzling me for a few days. :rolleyes:
Thx if you can help!