{
Parent, InsertControl, RemoveControl example
This example uses a button placed next to a group box. When the user clicks the button, the group box becomes the parent of the button, so the button moves inside the group box.
*) 
procedure TForm1.Button1Click(Sender: TObject);
begin
  RemoveControl(Button1);
  GroupBox1.InsertControl(Button1);
end;
Note that it was necessary to remove the button from the Controls property of the form before the button actually moves into the group box.
This code accomplishes the same thing:
*) 
procedure TForm1.Button1Click(Sender: TObject);
begin
Button1.Parent := GroupBox1;
end; 
