I think he wants to do what the thread title is asking.
In which case, you have to get the right namespace and then create an instance of the name, then convert it to a form object.
This assumes the name of the form is in a textbox, but you could also use a listbox, or a combobox or anything else capable of storing a string.
vb.net Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim FullTypeName As String = Application.ProductName & "." & TextBox1.Text Dim FormInstanceType As Type = Type.GetType(FullTypeName, True, True) Dim objForm As Form = CType(Activator.CreateInstance(FormInstanceType), Form) objForm.Show() End Sub




Reply With Quote