This 3 classes structure is a simplified view of my code :
Base class :
Public Class A
Public x As Integer
Protected Function G() as Integer
Return x
End Function
Protected Sub S(value as Integer)
x = value
End Sub
Public Function Test()
Return x + 10
End Function
End Class
Subclasses :
Public Class B
Inherits A
Public Property Prop As Integer
Get
Return G()
End Get
Set(ByVal Value As Integer)
S(Value)
End Set
End Property
End Class
Public Class C
Inherits A
Public InnerB As New B
End Class
The goal is to be able to code something like that :
Dim B1 as New B
Dim C1 as New C
B1.Prop = 10
C1.InnerB.Prop = 20 'the "x" member inherited from A takes the value 20 for the InnerB object but not for the C1 object.
MsgBox(B1.Test()) ' returns 20. Works!
MsgBox(C1.Test()) 'returns 10 instead of 30.
Is it possible to fill the inherited "x" member from C by calling the "prop" from it's inner class B ?