views:

499

answers:

2

I've got a base form in Delphi 2007 that I'd like to reuse in another project, adding some other buttons and such.

I'm familiar with subclassing a non-GUI object, but it is possible to subclass a Form in the same fashion? Can you make changes to the subclass Form in design mode?

How do you go about doing this and what are some things to look out for?

+1  A: 

You should add your base form to your new project and in the new form window there should be an Inherit tab where you can select a base form for the new form.

idursun
+7  A: 

As idursun said (he was a little quicker than me):

Add the base form to your new project. Then choose "File\New\More..." Form the "Delphi-Projects" branch select "Inheritable Elements", find your base form and click "OK".

(The actual names of the menu items may vary since I am using a german version of Delphi 2009)

You can then make changes to your new or your base form. If I do so I make sure to have both forms open in the IDE since sometimes it seems Delphi doesn't get all the changes if I don't.

Andreas Wieland