我有一个 ClassA 类,在其中创建另一个 ClassB 类的对象(classB_obj)。如何使用这个 classB_obj 访问/设置 ClassB 内部结构的值?我不熟悉 vb.net 中的语法。我想做的是这个
Public ClassA
Public Sub SomeSub
Dim ClassB_obj As New ClassB()
Dim classB_struct As ClassB.sampleStruct 'The error is **Type ClassB.sampleStruct not defined**
End Sub
End ClassA
Public ClassB
Private Structure Struct
Dim xy As String
Dim yz As String
End Structure
Dim sampleStruct As Struct
'Member functions here
End ClassB
错误是Type ClassB.sampleStruct 未定义
谁能告诉我哪里出错了。这里是 vb.net 的新手,不熟悉语法。非常感谢