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