G
Guest
I have a class named "myclass" and an arraylist containing elements of type
"MyClass". I want to get the value of a property of "MyClass" (a string
type) for one of the arraylist elements.
I can get this using:
dim b as string
b = DirectCast(myarraylist(0),myclass).myproperty
However, I want to use an object to define the type "MyClass" like:
dim C as type = type.GetType(myarraylist(0))
b = DirectCast(myarraylist(0), C ).MyProperty
but I get a "c" type not defined. How can I do this?
Thanks for any help.
"MyClass". I want to get the value of a property of "MyClass" (a string
type) for one of the arraylist elements.
I can get this using:
dim b as string
b = DirectCast(myarraylist(0),myclass).myproperty
However, I want to use an object to define the type "MyClass" like:
dim C as type = type.GetType(myarraylist(0))
b = DirectCast(myarraylist(0), C ).MyProperty
but I get a "c" type not defined. How can I do this?
Thanks for any help.