Forms Inheritance for Delphi 5... easy points?

A rookie question, in two parts....

1) I've designed a form which will be needed several times later so I'd like to use inheritance to be able to enrich the inherited forms. The only problem is that the layout on the inherited form doesn't appear on the delphi 5 editor window, it seems to be empty but if I run it I have the layout of the master form... How to fix that to be able to see the inheritated layout?

2) I've try to add the master form to the object repository but it don't offer me the possibility to use inheritance afterwards (the bullet is grey, I can only do a copy). Why?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

first check you have both files pas and dfm for your form..
next - ensure you have open project when trying to create new inherited form.

two ways to inherit a form without adding it to repository:
1a- create new form, add components you need and save.
1b- create new form, add to uses clause parent forms unit and change class declaration to be inherited from your parent form.
    TForm2 = class(TForm1)
1c- edit inherited forms dfm (by pressing alt+f12 when form is visible) and change in first row object to inherited, press alt+f12 and there must be all of your parent components.

2a- see 1a
2b- choose File | New.. find a tab named by your project name (Project1 for examp.) and choose your new form to inherit from existing form in your project.

wbr, mo.
usa4manuAuthor Commented:
I've a problem remaining with the 1c...

Could U give me an example? Thx
in design mode right click form and choose View As Text menu item, you will see something like this:

object Form2: TForm2
Caption = '..'

change 'object' to 'inherited':
inherited Form2: TForm2

press Alt+F12 or by rightclicking in editor chose View As Form. that's all - you must see your new child form :)

wbr, mo.
note: both forms must be added to active Project or otherwise Delphi will not find your parent form.. generally your parent form must been added to project whenever you uses inherited forms.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
usa4manuAuthor Commented:
Thx! 50 more for the quick answer! CU MaNu
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.