Inheritance property

Results 1 to 2 of 2

Thread: Inheritance property

  1. #1
    Join Date
    Dec 1969

    Default Inheritance property

    How to create multiple inheritance of property<BR>This is an example on what I means...<BR><BR><BR><BR>in .NET you have often this kind of use<BR><BR>treeView.Nodes[0].Add(...)<BR>treeView.Nodes.Count;<BR><BR>How to??<BR><BR><BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Has nothing to do with inheritance

    A treeView *contains* a collection named "Notes". And .Count is simply a property of whatever that collection type is.<BR><BR>That is:<BR><BR>class myCollectionType<BR>{<BR> public int Count { get .... }<BR> ...<BR>}<BR><BR>class myTreeView<BR>{<BR> public myCollectionType Nodes;<BR> ...<BR>}<BR><BR>and then in some other code you do<BR> myTreeView treeView;<BR>and then of course<BR> treeView.Nodes.Count; <BR>refers to the Count property of the instance of myCollectionType that is a public member of the myTreeView class.<BR><BR>There&#039;s not a lick of inheritance involved in this.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts