Search code examples
vb6

Create duplicate form in Visual Basic 6.0


I have a form (for example, abc.frm). I want the duplicate form (for example, xyz.frm) of abc.frm. I don't want to create it again. So I used the Save As option. But it did not appear in Project Explorer.

To solve this I did as follows.

  • I found xyz.frm in the source folder
  • Opened it with notepad
  • Changed form name from abc to xyz

But now I can not find the abc.frm file in Project Explorer.

If Save As is the correct option to create a duplicate form then What is the solution to keep both files?. If not then How do I create duplicate form?


Solution

  • "Save as" will save the form as the new name AND change the reference in the project to the new form file.

    You can either:

    1. Create form ABC
    2. Save as ABC.frm
    3. Change name to XYZ
    4. Save as XYZ.frm
    5. Re add ABC.frm to the project

    or:

    1. Create form ABC
    2. Save as ABC.frm
    3. Copy ABC.frm to XYZ.frm
    4. Edit XYZ.frm to use the new name
    5. Add XYZ.frm to the project