Open a form dinamic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a textbox, and I want to open the form that is writen in it
I tryed some code, but it didn't work
Form oform = (Form)System.Reflection.Assembly.CreateInstance(txtNomeEcran.Text)

Can you help
Thanks
 
Hi Bernardo,

You should use an instance of an assembly.
An example:
Form oform =
(Form)Assembly.GetExecutingAssembly().CreateInstance(textBox1.Text);

And make sure you pass the full name of the form (with namespace).
 
Back
Top