How to create an object of type returned by a property

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have a property:

Protected Overrides ReadOnly Property ListItemType() As Object
Get
Return GetType(myObject)
End Get
End Property


How could i create a new object of the type 'myObject' that is
returned by this property ?


All my classes have a property like this, and each of these classes
through this property return their type.

I want to be able to read this property and create a new object of
that type is it possible ?

Thanks in advance

p.s. All of 'myObject' classes, inherit from myObjectBase if this
helps.
 
* (e-mail address removed) (Alex) scripsit:
Protected Overrides ReadOnly Property ListItemType() As Object
Get
Return GetType(myObject)
End Get
End Property


How could i create a new object of the type 'myObject' that is
returned by this property ?

'Activator.CreateInstance'.
 
Back
Top