Is there a way to do a property with an indexer?

  • Thread starter Thread starter bcg
  • Start date Start date
B

bcg

I know that a Class can have an indexer, but can one or more
properties be created with an indexer? You could do this in VB6..
such as:

MyProperty (ByVal Index) As String
MyPropety = MyVal(Index)
 
Sure. For example

public string this[]{...}
public string this[int] {...}
public string this[string] {..}
public string this[string, object] {...}
 
Back
Top