Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleMake an indexed property in VB .NET
DescriptionThis example shows how to make an indexed property in VB .NET. In VB .NET, the Property statement includes the index parameter.
Keywordsproperty, indexed property, VB.NET
CategoriesVB.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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated