有人知道我为什么会收到错误消息吗?
NullReferenceExeption未处理。对象引用未设置为对象的实例。
具有以下代码
Class Test
Private Prop1 As Double
Public Property a() As Double
Get
Return Prop1
End Get
Set(ByVal value As Double)
Prop1 = value
End Set
End Property
End Class
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim u() As Test = New Test() {}
ReDim Preserve u(1)
u(0).a = 2.2 ' Here is the crack: "NullReferenceExeption was unhandled. Object reference not set to an instance of an object"
Exit Sub
End Sub
End Class