Access parent properties/methods?

C

Chris Ashley

Say I have a class called TabManager, which has an array of Tab
objects? There is no inheritance or other relationship between them
apart from the TabManager instantiating the tab objects and holding
them in an array. How can the Tab objects call the methods and access
the properties of its TabManager parent? Can I pass a pointer from the
TabManager to the Tab object in its constructor somehow?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Chris Ashley said:
Can I pass a pointer from the TabManager to the Tab object in its
constructor somehow?

Yes, that is how you do it, you need to pass a reference to the container


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top