Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 52145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:51:40+00:00 2026-05-10T16:51:40+00:00

I’ve been working on a project in Delphi 7 where I wanted to have

  • 0

I’ve been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I’m going to post the solutions to hopefully help others in the future):

  1. In the .pas file of a form, I would change the form to inherit from some other form, but it wouldn’t get the components from the ancestor form.
  2. For certain descendant forms, I would get the following error message when opening the form at design time: ‘Error creating form: Ancestor for ‘TAncestorForm’ not found.’ I would have to first manually open the ancestor form, and then I could open the descendant form.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:51:40+00:00Added an answer on May 10, 2026 at 4:51 pm

    First, for those who don’t know how to inherit a form visually, you create the ancestor form as usual. Then go to File > New > Other. Select the tab with the name of the current project, and choose the form you want to inherit from. If you want to inherit from a form that’s not part of the current project, open that form, right click it, and choose Add to Repository. Then you will be able to go to File > New > Other and select that form from the appropriate tab.

    Given that, I came across issues because some of the descendant forms were already created, so I couldn’t follow the process above. Also, I made some changes to forms from the standard code Delphi creates. I was able to resolve all issues with visual form inheritance using the following guidelines:

    • The .pas file of the descendant form must have the form’s class inherit from the correct ancestor class, e.g.:
      type TMyForm = class(TAncestorForm)
    • The first line in the .dfm of the descendant form must have the word inherited instead of object, e.g.:
      inherited MyForm: TMyForm
    • EDIT: After double checking, the following is NOT required: The .pas file of the ancestor form must have the standard global variable that Delphi creates, e.g.:
      var AncestorForm: TAncestorForm;
    • The uses section of the .dpr file of the project must have that same global variable as a comment after the unit’s file name, e.g.:
      unAncestor in 'unAncestor.pas' {AncestorForm}

    Notes/Tips:

    • Both the ancestor form and the descendant form are allowed to be non-auto created if you want (Set in Project > Options > Forms > Auto-create forms).
    • To revert a property on a descendant form to the ancestor form’s value, right click on the property in the Object Inspector, and choose Revert to inherited.
    • To revert all property values of a component to the ancestor’s values, right click the component and choose Revert to inherited.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 72k
  • Answers 72k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer My very first Google hit for 'g++ hash_map deprecated' takes… May 11, 2026 at 1:43 pm
  • added an answer Linq2sql doesn't support using cross datacontext objects directly -serialize/deserialize/attach is… May 11, 2026 at 1:43 pm
  • added an answer Using GetTickCount() and initializing variables: uses Windows; var mseconds, starttime:… May 11, 2026 at 1:43 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.