[DUG] Move/Paste Controls
Stefan Mueller
muellers at orcl-toolbox.com
Sat Dec 2 19:32:10 NZDT 2006
Two handy tips for changing parent relationships:
Tip 1:
Shift-Alt-F11 - shows the "Object Treeview" window (I usually have it docked
with my "Object Inspector" window as I find it a very useful window and
always want to have it open). Using this "Object Treeview" you can easily
drag the objects around (into your panel/bevel) to change the parent.
Tip 2:
The "Esc" key navigates to the parent of an object when pressed on the forms
designer window - This makes it easy to select those borderless container
panels that you often have to arrange content . or to go select the
containing form.
Kind Regards,
Stefan Mueller
_____
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Gary T. Benner
Sent: Saturday, December 02, 2006 12:28 PM
To: johnkbird at paradise.net.nz
Cc: delphi at ns3.123.co.nz
Subject: RE: [DUG] Move/Paste Controls
[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.
_____
Gary Benner
e-Engineer, Lecturer, and Software Developer
<http://www.123.co.nz> 123 Internet Limited
<http://www.waiariki.ac.nz> Waiariki Institute of Technology
<http://www.sunshinebags.co.nz> Sunshine Garden Bag Co.
<http://www.sommnet.com> Sommnet.com Limited
Mob: 021 966 992
Email: gary at 123.co.nz
Ref#: 41006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20061202/c8453a37/attachment-0001.html
More information about the Delphi
mailing list