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 61 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?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,875 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,671 questions
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 29,261 Reputation points Microsoft Vendor
    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,126 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).