An easy one. How to copy a button

Posted on 2005-05-03
Last Modified: 2010-04-05
Hello everybody.
I'm a begginer.
I have made a button using the PARENT, CREATE etc. commands.
And it shows on the form.

I dont want to use the VCL or the allready made button and put it six tims on the form.

Now I want to copy the same button 6 times in 20 points interval space.
And I dont know how to do it.
Please help.
Question by:liorb
    LVL 5

    Accepted Solution

    I can't really understand what you're asking. Is it something like this:

      i : Integer;
      aButton : TButton;
      for i := 1 to 6 do
        aButton := TButton.Create(Self);
        aButton.Caption := Button1.Caption;
        aButton.Left := Button1.Left;
        aButton.Top := Button1.Top + (i * 20);
        aButton.Parent := Self;
    LVL 1

    Author Comment


    yes this is it
    so simple

    but i'm a begginer
    have much to learn

    thank you very much.

    LVL 15

    Expert Comment

    A nice idea is to select the control on the form you are looking to copy, then do a normal windows CTRL+C, then go to notepad or something and then past the button to it. You can get a good idea of the basic properties you need to set for all components this way. Just a little bit of info for a beginner.
    LVL 1

    Author Comment


    thanks for the BIG tip.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now