Board index » delphi » Changing a control's parent at design time

Changing a control's parent at design time

Say I built a control onto a panel, changed lots of properties, and
wrote code for it.

Then I decide I want the control to actually be in a control bar, or on
the form (i.e. I need to change its parent).  How can this be done?
(without having to delete the control and create a new one, of course).

Thanks for any help.

Habib Debs

 

Re:Changing a control's parent at design time


Just change what the Parent property refers to:

  Button1.Parent := self;

 or

 Button1.Parent := Panel1;

--- x
==============================
Xavier Pacheco (TeamB)
xav...@xapware.com

Sorry but TeamB cannot answer support
questions received via email.

Re:Changing a control's parent at design time


Select the controls, CtrlX, select the new parent, CtrlV.

Rene

Quote
H. Debs wrote:

> Say I built a control onto a panel, changed lots of properties, and
> wrote code for it.

> Then I decide I want the control to actually be in a control bar, or on
> the form (i.e. I need to change its parent).  How can this be done?
> (without having to delete the control and create a new one, of course).

Other Threads