分配結構的變化,我有以下通過財產
Public Structure Foo
dim i as integer
End Structure
Public Class Bar
Public Property MyFoo as Foo
Get
return Foo
End Get
Set(ByVal value as Foo)
foo = value
End Set
dim foo as Foo
End Class
Public Class Other
Public Sub SomeFunc()
dim B as New Bar()
B.MyFoo = new Foo()
B.MyFoo.i = 14 'Expression is a value and therefore cannot be the target of an assignment ???
End Sub
End Class
我的問題是,爲什麼我不能過我的財產在酒吧類分配給我?我做錯了什麼?
很奇怪,不是行爲我期待 – Jodrell 2011-06-01 11:40:36
同樣的事情更直接的方式'我'的保護/訪問級別是相關的,但我同意不是問題 – Jodrell 2011-06-01 12:07:29