I have created a class with a Private Dynamic Array of String.

I wrote the following class with properties to access the array.

VB Code Code:
  1. Public Class MyClass
  2. Private c_Text As String()
  3.  
  4. Public Sub New()
  5.    ReDim c_Text(0)
  6. End Sub ' New
  7.  
  8. ReadOnly Property NumText() As Integer
  9.    Get
  10.       Return UBound(c_Text) + 1
  11.    End get
  12. End Property ' NumText
  13.  
  14. Property Texts(ByVal Index As Integer) As String
  15.         Get ' Return Text
  16.             If (0 <= Index) And (Index < NumText()) Then
  17.                 Return c_Text(Index)
  18.             Else
  19.                 Return ""
  20.             End If
  21.         End Get
  22.         Set(ByVal value As String)
  23.             If (0 <= Index) And (Index < NumText()) Then
  24.                 c_Text(Index) = value
  25.             Else
  26.                 ReDim Preserve c_Text(NumText() + 1)
  27.                 c_Text(NumText()) = value
  28.             End If
  29.         End Set
  30. End Property ' Texts
  31.  
  32. End Class ' My Class

My Problem starts when I try to use the Property Texts.

VB Code Code:
  1. MsgBox (Texts(0))

Causes no errors.

However, when I try to use the Set part I get an error message.

VB Code Code:
  1. Texts ("Test Message")

Property access must assign to the property or use its value.

In the documentation I have looked at (Various books and MSDN and Online
Help) it clearly indicates that properties can have parameters, and my
declaration of Texts throws up no errors.

But nowhere can I find an example showing a Property with a Parameter List being used.

Can you advise where I am going wrong, and how to correct it please.
So far all the examples I have found on MSDN and VBForums