Last Updated: August 17, 2017
·
1.609K
· Tats

How does one resize an array within property methods in vb.net?

Here's how I tried to approach the situation:
'Declare Name Array Property
Public Property Name(ByVal index As Integer) As String
Get
index = nStudents
Return _Name(index)
End Get
Set(value As String)
End Set
End Property
'Declare Dishes Array Property
Public Property Dishes(ByVal index As Integer) As Integer
Get
Return _Dishes(index)
End Get
Set(value As Integer)
End Set
End Property
Public Sub New() 'Resize _Name And _Dishes Arrays
ReDim _Name(nStudents)
ReDim _Dishes(CInt(nStudents))
End Sub