Hello,
"Shayne H" <shaynehATlycosSPAMGOTOHELLcoDOTuk> schrieb:
> I was using the following code to create a form from its class name. It
was
> working then at some point I must have broken it, and now have no idea why
> it will not work. The CreateInstance method returns <Nothing>
This works for me:
\\\
Dim objNewForm As Object = _
Activator.CreateInstance( _
Type.GetType("MyApplication.SampleForm") _
)
Dim frm As Form = DirectCast(objNewForm, Form)
frm.Show()
///
HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet