How to maximize a form in a Tpanel using delphi

1k Views Asked by At

i'm trying to dynamically show a form in a TPanel using this function

procedure Show_form_in_panel(form: TForm; Panel: Tpanel);
begin
  form.Parent := Panel;
  form.Show;   
  form.WindowState := wsMaximized;
end; 

the form is showing very normal but he's not maximized in my panel and also i want to make this form automaticly react like components that have the Alight property = (alClient)

1

There are 1 best solutions below

0
David Heffernan On BEST ANSWER

I want to make this form automatically react like components that have the Align property set to alClient.

That's the solution. Remove

form.WindowState := wsMaximized;

and replace with

form.Align := alClient;