Results 1 to 2 of 2

Thread: [02/03] Class Instance Callback

  1. #1

    Thread Starter
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120

    [02/03] Class Instance Callback

    I have created an instance (C) of a class from within a windows form (W1), but I need to call back a particular sub in the parent (W1) from that class (C), how can I do this? (This instance (C) will be created again by another windows form (W2) and it will call another particular sub in that window (W2)).

    Thanks.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: [02/03] Class Instance Callback

    The standard way would be for C to raise an event that the form can consume. This is how controls and most object work. An alternate path is also to pass in a delegate that points to a method in the form - which is essentially what the event. The second method offers little advantage and is not as standard as events but is harder to implement.

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