How to get a Form object through the form name

H

Hari

Hi,
I need to get a form instance, by supplying the form name i.e, i
need some thing similar to Class.forName() in Java. I tried it using
System.Type.GetType() method passing the form name as object. But the
prob here is i'm getting an exception saying "System.Type can not be
casted to a System.Windows.Form". How can i get the form object based
on the form name. Any one plz suggest.

Thanks,

Hari
 
H

Hari

Hi Chris,
Thanks for the suggestion. I've already downloaded your class
previously. That was working fine, but for controls other than a Form.
As you have used Parent property which is null for a Form, this does
not work on a Form as it is. Please suggest what has to be modified to
make it work for a Form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top