Collection of classes

N

Nikolay Petrov

When create an array of type some class I can access the class method this
way:

Dim AccClass(1234) as SampleClass
arrClass(i).ClassMethod

Is the same possible with ArrayList or other type of Collection?

Thanks in advance
 
A

alejandro lapeyre

well, you can do this

CType(myList(i), SampleClass).ClassMethod

or at least define:

Function SampleClassItem(index as integer) as SampleClass
return CType(myList(index), SampleClass)
End Function

and then you can use:

SampleClassItem(i).ClassMethod

Best Regards,
Alejandro Lapeyre


"Nikolay Petrov" <[email protected]> escribió en el mensaje
When create an array of type some class I can access the class method this
way:

Dim AccClass(1234) as SampleClass
arrClass(i).ClassMethod

Is the same possible with ArrayList or other type of Collection?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top