Link to home
Start Free TrialLog in
Avatar of Nicholasjf
Nicholasjf

asked on

Delphi - replicating a form

I want to make a new form/unit from existing form,. So I want all the forms objects to be reproduced, but I don't want the two forms to be related, so that changes to one form do not affect the other.  What is the best way of doing this,. please?
Avatar of ste5an
ste5an
Flag of Germany image

Copy the files?
Avatar of Nicholasjf
Nicholasjf

ASKER

Sorry I am a newbie. I'm unable to answer your question.
In such a situation, I just copy the form files and adjust the class name in both files.
The best way is to add the Form you want to be copied to the repository.
Let's say you have a TForm called Form1 that you want to reproduce exactly into a second TForm

Right click on the form in design mode and choose 'Add to Repository'
A dialog will ask you to add a Name and a description to this Form

Then, from the IDE manu, selecting File-New-Other you will find the form into the Delphi Files group.
You can choose to simply Copy that form to a new one, inherit it or simply use it.
This is the best and correct way to do this.User generated imageUser generated image
Many thanks.
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
it's custom to accept the actual answer that really helped

not a request to accept an answer