[DUG] Move/Paste Controls
Gary T. Benner
gary at 123.co.nz
Sat Dec 2 16:27:40 NZDT 2006
[Reply]
HI all
At 15:25 on 2/12/2006 John wrote
>One thing I have never found easy to do - if I have a form which has a
>number of components on it, and later I decide to add either a bevel or page
>control to organise the layout better there is no easy way to move existing
>components into the page control/bevel - if dragged or cut/paste they
>instead end up being behind it.
> >There is an option to highlight the control and select "bring to front" but
>this doesn't seem to work consistently (eg it seemd to work for edit control
>and not labels and stupid things like that) - it doesn't seem to actually
>put it inside one or other tabsheet for instance which is the logical thing
>I would be wanting to do....
> >It can be done by editing the DFM, but is there an easier way? - as that is
>a tad fiddly and slow...
It is important to understand the concept of a component's "parent".
When you place a component such as a TButton on a form, the form becomes it's "parent". This is a visual "containership".
If you now place a TPanel on a form, the same thing happens, but when you drop another TButton on the panel, the panel becomes it's parent, not the form.
In fact if you try and move the second button, it's visibility is "contained" in the bounds of the panel.
So the idea to "bring to front" or modify the "Z-order" is not really relevant here.
The easy way to handle your situation is to just cut and paste - ie cut the component you want to move, and paste it into the component that can contain other components( eg TPanel, TGroupBox, TPageControl etc ). For instance, you cannot have a TButton contain other components.
kind regards
Gary
PS: Don't get confused with a component's "owner" which is responsible fo it's destruction.
Ref#: 41006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20061202/bb5a01ec/attachment.html
More information about the Delphi
mailing list