|
-
Sep 27th, 2006, 04:10 PM
#1
Thread Starter
Lively Member
[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.
-
Sep 27th, 2006, 11:01 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|