我有一个名为cTask用下面的代码在它模块:SUB房产
Private pMile As String
Public Property Get Mile() As String
Mile = pMile
End Property
Public Property Let Mile(Value As String)
pMile = Value
End Property
所以在我的子可以说我发起
dim currtask as cTask
我还想写
curtask.Mile=TIM
也
curtask.Mile.stat=2
就像
worksook("qqq").sheets("okko").cells(1,1)...
我怎么做我班上嵌套的属性?
编辑: 名为cTask
Private pMile As cMile
Public Property Get Mile() As String
Mile = pMile
End Property
Public Property Let Mile(Value As String)
pMile = Value
End Property
一个类,并在类cMile我
Private pstatus As String
Public Property Get status() As String
status = ppstatus
End Property
Public Property Let status(Value As String)
pstatus = Value
End Property
然后在我的子我要做的就是等有申报
dim curtask as cTask
它是否正确?它不工作,所以我一定是错过了一些东西
你需要用适当的属性创建一个'clsMile'类,并且让你的'pMile'类型为clsMile而不是String。一旦'curTask.Mile'属性表示一个对象,你将需要在赋值时使用Set。 –
我不知道我得到了那一切。我写了,我在编辑我的帖子 – user2385809