How do I add an existing form from another VB.NET project to my new VB.NET project? I have several forms that I want to reuse.

Marc Menzel 121 Reputation points
2022-04-20T09:25:21.427+00:00

How do I add an existing form from another VB.NET project to my new VB.NET project? I have several forms that I want to reuse. Do I just Select the Add Existing Item and select the desired Form.vb file in my existing VB.NET project?

Developer technologies Windows Forms
Developer technologies VB
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2022-04-21T01:39:43.497+00:00

    Hi @Marc Menzel ,
    First make sure that the name of the form does not conflict with the existing form, and then copy the vb, Desiner.vb, and resx files related to the form to the target directory.
    Choose Show All Files, and you will see the form in Solution Explorer.
    194896-image.png
    Include In Project and it will automatically recognized as a form.
    194866-image.png
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    5 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. LesHay 7,141 Reputation points
    2022-04-20T11:36:43.21+00:00

    Hi
    Can be tricky, at least in my experience. You can right click on your project in Project Explorer and choose Add existing item, then navigate and choose the Form you want to add. Depending on what you have imported, you may have a lot of cleaning up to do. You will also need to consider renaming your own Form to prevent naming clash (trying to Add new Form1 to a project already with a Form1 will not work).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.