This is not a trivial task. If all you have is the simple form name as a string, then you need to use some sort of Reflection to create an instance of that type, AND you have to use the full name of the type, which is "Namespace.Type". Here's one approach: "Loading Classes on the Fly" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet10082002.asp Here's a similar way, that does not use a configuration file. I just used the assembly name, which should work, unless you or another developer has placed the forms in a different namespace. Either way, you have to know the namespace of the type. If it happens to be the same as the assembly, which usually it will be, then you're in good shape. If not, you just have to know the namespace, and prepend it to the form name. (And don't forget to use proper exception handling. Do as I say, not as I do.)
Imports System.Reflection
Module Module1
Friend Function GetFormUsingGetType(ByVal formName As String) As Form
Dim myAssembly As [Assembly] = [Assembly].GetExecutingAssembly
Dim myForm As Form
Dim myFormName As String
Dim myType As Type
Dim myAssemblyNameObj As AssemblyName = myAssembly.GetExecutingAssembly.GetName
Dim myAssemblyName As String
myAssemblyName = myAssemblyNameObj.Name
myType = myAssembly.GetType(myAssemblyName & "." & formName, True, True)
myFormName = myType.FullName
myForm = CType(myAssembly.CreateInstance(myFormName), Form)
Return myForm
End Function
Friend Function GetFormUsingActivator(ByVal formName As String) As Form
Dim myForm As Form
Dim myFormName As String
Dim myAssemblyNameObj As AssemblyName = [Assembly].GetExecutingAssembly.GetName
Dim myAssemblyName As String
Dim obj As System.Runtime.Remoting.ObjectHandle
myAssemblyName = myAssemblyNameObj.Name
myFormName = myAssemblyName & "." & formName
obj = Activator.CreateInstance(myAssemblyName, myFormName)
myForm = CType(obj.Unwrap, Form)
Return myForm
End Function
End Module