Inner class problem.

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

Hello.
I have a control :
public class myClass
private class myInnerClass
...
end class

end class

How myInnerClass can access myClass ?

Need sample, please.

Thanks :)
 
Hello.
I have a control :
public class myClass
private class myInnerClass
...
end class

end class

How myInnerClass can access myClass ?

Public Class myClass

Private Class myInnerClass
Private Sub New()
End Sub

' "Friend" just in case we ever make this class Public.
' Only code in this Assembly can create these.
Friend Sub New( byval parent as myClass )
m_parent = parent
End Sub

Private m_parent as myClass = Nothing

Private ReadOnly Property Parent() as myClass
Get
Return m_parent
End Get
End Property

End Class

End Class

Code within myInnerClass should reference the parent object by
Me.Parent. ...

HTH,
Phill W.
 
Am 11.06.2010 11:49, schrieb Mr. X.:
Hello.
I have a control :
public class myClass
private class myInnerClass
...
end class

end class

How myInnerClass can access myClass ?

Which instance of myClass? There can be 0 to many instances.
 
Back
Top