Yes:
X = System.Activator.CreateInstance(t)
--
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ramez" <ra***@newsgroup.nospam> escribió en el mensaje
news:uY**************@tk2msftngp13.phx.gbl...
Hi
I need to create an object of a class using a type variable.
for example, instead of writing:
X = new MyClass
I want to write something like:
Dim t as Type = GetType(MyClass)
X = CreateObjectFromType(t)
is this possible?