Hi everyone, i want to open a form
I’m making a shortcut system, and I need the shortcut to know which form to open. Inside this control I’m waiting in the variable “form_name” the name of a form that exists in my project, how can I convert this string “form_name” to a Form object and open it? Something like this:
Dim frm As Form
Dim formName As String = “Form1”
formName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name & “.” & formName
frm = DirectCast(Activator.CreateInstance(Type.GetType(formName)), Form)
frm.Show()
Is this possible in WiseJ? Thanks!
Hi Ruben,
Activator.CreateInstance has a string constructor you can use. See the following docs for an example.
Just make sure you’re using the fully qualified name of the control.
HTH,
Levie
Please login first to submit.