Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
How can I reuse an existing form to make a new one, didn't find any reference to this in my VB6 books.

It depends up what you mean by reuse a form.
If you have a new project and want to use a form from another project:
Copy the form (.frm) file from the old project's folder into the new project's folder
From the menu:
Select Project
Select Add Form
Select Existing
Select the form from the new project's folder===============================================================
If you an existing form in the project and want to reuse parts of it you can copy the objects from the old form to the new one:
Create new form from the menu:
select Project
select Add
select OpenCopy objects from old form:
Select old form
Select all the components by using Ctrl-A from the keyboard
Select new form
Paste all the components by using Ctrl-V from the keyboardThis only copies the objects not the code. You must copy the code from the old form manually to the new form.

if u want to make a new instance of the form during run time:
dim frmNew as frmOriginal
set frmNew = new frmOriginal
frmNew.showthis code creates a form (frmNew) exactly like the original form (frmOriginal), controls and code.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |