I can now drag and dock a form onto another. There is however some strage sideeffects "docking" it. There are two problems in this demo code (see picture):

1) There's a problem with the clientwidth/clientheight, non client area is calculated as width/height. 2) The three forms behave like forms while they should not. They behave like 3 controls floating *anchored* on top of the parent. If i set tabstop to true i can tab between them, i can close each of them with Alt-F4 and i can also resize them.

I'm lost on the first one and i have no idea where to start looking, does anybody have a hint for me or have a quick solution?

Greetings,
Marius

procedure TForm1.Button1Click(Sender: TObject);
var AForm: TForm;
begin
  AForm := TForm.Create(Self);
  AForm.Parent := TWinControl(Self);
  AForm.Align := alTop;
  AForm.Color := clGreen;
  AForm.Visible := true;
  AForm.Visible := true;

  AForm := TForm.Create(Self);
  AForm.Parent := TWinControl(Self);
  AForm.Align := alBottom;
  AForm.Color := clRed;
  AForm.Visible := true;
  AForm.Visible := true;

  AForm := TForm.Create(Self);
  AForm.Parent := TWinControl(Self);
  AForm.Align := alClient;
  AForm.Color := clGreen;
  AForm.Visible := true;
  AForm.Visible := true;
end;

<<inline: DockForms.png>>

Reply via email to