Add Existing Item does not work for adding Forms

  • Thread starter Christopher W. Douglas
  • Start date
C

Christopher W. Douglas

I am building a VB.NET application in Visual Studio.NET 2003. I have an
existing project with code and forms I want to reuse in this project. If I
am copying a module file, then Add Existing Item works fine. However, if I
am copying a form, it pulls it in as a module file, not as a form. I have
tried adding the .resx file first, adding the .vb and .resx file at the
same time, or deleting the .resx file, nothing seems to work. I have a
module file with all the code to make it a form, but VS still thinks it's a
code file. I am also using Visual Source Safe, if that helps.

The only solution I have found is to create a new form, then cut and paste
the code from the existing file. Please, can someone tell me a SIMPLE way
to add an existing form? Thanks.
 
H

Herfried K. Wagner [MVP]

* "Christopher W. Douglas said:
I am building a VB.NET application in Visual Studio.NET 2003. I have an
existing project with code and forms I want to reuse in this project. If I
am copying a module file, then Add Existing Item works fine. However, if I
am copying a form, it pulls it in as a module file, not as a form. I have
tried adding the .resx file first, adding the .vb and .resx file at the
same time, or deleting the .resx file, nothing seems to work. I have a
module file with all the code to make it a form, but VS still thinks it's a
code file. I am also using Visual Source Safe, if that helps.

Did you try it with a test project which is not under source control?
Does it work there? Are you sure you /referenced/ the file only and it
didn't get copied over to the folder of the other project (this can be
selected in the dialog used to choose which file to add by choosing the
appropriate option from the dropdown button).

Why not create a class library which contains the form classes and
reference this class library from all the projects which need the common
forms?
 

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