Please look the following code. I am getting error in the line
MySrs(1).A=10
It is probably that I havenot created an instance of class, MyPoint.
please help me to solve it.
Thanks
Mahendra
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MySrs As New MySeries(20)
MySrs(1).A = 10
End Sub
End Class
Public Class MySeries
Private mPoint() As MyPoint
Public Sub New(ByVal Size As Integer)
ReDim mPoint(Size)
End Sub
Default Property Mpnt(ByVal index As Integer) As MyPoint
Get
Return mPoint(index)
End Get
Set(ByVal value As MyPoint)
mPoint(index) = value
End Set
End Property
End Class
Public Class MyPoint
Dim mA As Double
Property A As Double
Get
Return mA
End Get
Set(ByVal value As Double)
mA = value
End Set
End Property
Dim mB As Double
Property B As Double
Get
Return mB
End Get
Set(ByVal value As Double)
mB = value
End Set
End Property
Dim mC As Double
Property C As Double
Get
Return mC
End Get
Set(ByVal value As Double)
mC = value
End Set
End Property
End Class
MySrs(1).A=10
It is probably that I havenot created an instance of class, MyPoint.
please help me to solve it.
Thanks
Mahendra
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MySrs As New MySeries(20)
MySrs(1).A = 10
End Sub
End Class
Public Class MySeries
Private mPoint() As MyPoint
Public Sub New(ByVal Size As Integer)
ReDim mPoint(Size)
End Sub
Default Property Mpnt(ByVal index As Integer) As MyPoint
Get
Return mPoint(index)
End Get
Set(ByVal value As MyPoint)
mPoint(index) = value
End Set
End Property
End Class
Public Class MyPoint
Dim mA As Double
Property A As Double
Get
Return mA
End Get
Set(ByVal value As Double)
mA = value
End Set
End Property
Dim mB As Double
Property B As Double
Get
Return mB
End Get
Set(ByVal value As Double)
mB = value
End Set
End Property
Dim mC As Double
Property C As Double
Get
Return mC
End Get
Set(ByVal value As Double)
mC = value
End Set
End Property
End Class