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

  • SEARCH
  • Home
  • 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 315787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:19:25+00:00 2026-05-12T08:19:25+00:00

I have two forms,one is main and other is inherited form main.Lets say I

  • 0

I have two forms,one is main and other is inherited form main.Lets say I have a function on the main form:

procedure FormMain.CreateButton;
begin
  with TsButton.Create(Self) do begin
    Width := 31;
    Height := 31;
    Left := 31;
    Top := 31;
    Visible := true;
    Parent := Self;
  end;
end;

Usually everything on the main form should be on the inherited form,but this is what I do:

I call CreateButton from mainForm ,but the button is only on the main form.

Is it possible to inherit that button too?

  • 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. Editorial Team
    Editorial Team
    2026-05-12T08:19:25+00:00Added an answer on May 12, 2026 at 8:19 am

    There’s a difference between design-time and runtime. The form designer creates a definition for your form, which it instantiates at runtime. If you inherit one form from another, then it takes the base template and adds to it. But form-designer forms are only templates, like class definitions.

    Now, at runtime, you instantiate a base form and a derived form, and it creates them from the templates stored in the resource section of your app. If you add something to the instance of the base form, you’re modifying an individual instance, not the definition, so of course it’s not going to show up on another instance. If you want to add a button dynamically to a form, you have to create it on that instance (in this case, the derived form) individually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms, one is the main form and the other is an
I have two forms(one main form,and one submain form).I'd like to do something like
I'm using the jQuery Validation JS I have two contact forms, the main one
I have two Forms. One with where all the main code is being executed.
I (currently) have two forms, one that needs to call the other. In other
I have created two forms in my Windows Application. One Form acts as a
I have a main form that contains two other child subforms. When a textbox
I have two forms, in the main one a have a crystalreportviewer and in
I have a MDI Windows Forms application. The main form, among the other events,
I have two forms in my application, one form is to create new connections,

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.