Results 1 to 1 of 1

Thread: [2005] A question about passing Delegates to an object (maybe)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    252

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

    Thx if you can help!
    Last edited by Flying-Kiwi; Mar 8th, 2007 at 02:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width