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 1008955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:51:07+00:00 2026-05-16T08:51:07+00:00

If I am using Delphi at design time, then when I copy/paste a group

  • 0

If I am using Delphi at design time, then when I copy/paste a group of components at design time, the pasted components are slightly offset from their originals.

However, I am developing a GUI which allows users to develop a GUI for another app. When I cut/paste the pasted components lie directly over the originals. Is there are way to offset them slightly?

  • 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-16T08:51:08+00:00Added an answer on May 16, 2026 at 8:51 am

    Since you have the basic copy/paste working, the next bit is a fairly simple extension to what you already have.

    Pasting does of course – presumably – paste the copied controls with their copied property values, so yes they will over-lay on top of the original controls from which they were copied.

    To get off-setting behaviour, you will have to do some “nudging” of the pasted controls after they have been pasted. If you cannot get a list of the pasted controls more directly, then one way to derive such a list would be to take a copy of the Components collection of the target form before pasting, then after pasting iterate over the Components collection once again – any item now in the collection and not in the “original” list must have been pasted and you can apply your Left/Top nudges to those as required.

      list := TList.Create;
      try
        for i := 0 to Pred(dest.ComponentCount) do
          list.Add(dest.Components[i]);
    
        // Do your pasting
    
        for i := 0 to Pred(dest.ComponentCount) do
          if list.IndexOf(dest.Components[i]) = -1 then
            // Nudge dest.Components[i]
      finally
        list.Free;
      end;
    

    That should get you at least heading down the right direction I think.

    NOTE: The above code assumes you are dealing (potentially) with TComponent derived classes (i.e. non-visual components). If you are dealing only with TControl descendants then you could optimise by working with the ControlCount and Controls of the destination container control (not necessarily the form).

    Also, the Left/Top position of a TComponent is stored in the lo/hi word of the public DesignInfo property, so your nudge code will need to take that into account and deal with TComponent derived controls differently from TControl if you are working with non-visual components as well as visual controls.

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

Sidebar

Related Questions

I have been trying to find a good-looking design using Aero in Delphi 2010.
I am using Delphi version 5.0 and i have installed the DOA components for
Using delphi 7 TRichEdit component, RTF data is being imported from a msword document
I am using Delphi 7 and ICS components to communicate with php script and
I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code
Using Delphi 7 I am reading from a serial port. The read is always
Someway to override Delphi default procedures at Design Time ? I need to override
In Delphi 2007, images are loaded in a TImageList at design time. This introduces
Using Delphi XE 2 I've trying to identify the zoom direction to apply the
Using Delphi 2010 and a patched version of the BDE I run into a

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.