|
|
Title | Make an indexed property in VB .NET |
Description | This example shows how to make an indexed property in VB .NET. In VB .NET, the Property statement includes the index parameter. |
Keywords | property, indexed property, VB.NET |
Categories | VB.NET |
|
|
In VB .NET, you include the index parameter in the Property statement. In this example, the test_number parameter is the index for the Scores property.
|
|
Public Class Student
' The private array of scores.
Private m_Scores(9) As Integer
' The indexed Score property procedures.
Public Property Score(ByVal test_number As Integer) As _
Integer
Get
Return m_Scores(test_number)
End Get
Set(ByVal Value As Integer)
m_Scores(test_number) = Value
End Set
End Property
End Class
|
|
|
|
|
|