Loading a form from another project

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

Guest

Hi,
I created a form in a project & wish to use it in another project. I Right
click the project in the project explorer, & choose Add, then I choose
Existing item & navigate to the FormMyForm.cs file. I do not link the file;
it is a new item.
I add it to the project & can see it in the project explorer, however,
intellisense doesn't recognise it as being part of the project. I cannot
instanitate it because it doesn't 'exist' in the project. I save & rebuild
but nothing changes. This works with class files. Why not forms?

Is there something I've missed?

Thanks in advance for any ideas.
Ant
 
Ant said:
Hi,
I created a form in a project & wish to use it in another project. I Right
click the project in the project explorer, & choose Add, then I choose
Existing item & navigate to the FormMyForm.cs file. I do not link the
file;
it is a new item.
I add it to the project & can see it in the project explorer, however,
intellisense doesn't recognise it as being part of the project. I cannot
instanitate it because it doesn't 'exist' in the project. I save & rebuild
but nothing changes. This works with class files. Why not forms?

Is there something I've missed?

Thanks in advance for any ideas.
Ant

You've probably missed the namespace.
Solution :
a. try using fully qualified name for the form class ie including the
namespace.
b. change the namespace of this form to the namespace of your project.

Vivek
 
HI Pop,
That was it. I changed the namespace & there you go.

Thanks very much for your assistance.
Regards
Ant
 
Back
Top