Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Master Class then 2 child classes i have a timer in childclass1 which will give some value
i have to copy this value to childclass2
and show by using only masterclass

please give me a sample code to attain this.

NOTE: No Static variables and No cyclic References
Posted

1 solution

Use events: child class1 raises an event, which is handled in the MasterClass - it then routes the info to the second child class instance.

Have a look at this: Transferring information between two forms, Part 3: Child to Child[^] - it's form oriented, but it's exactly the same principle and technique for "normal" classes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900