delphitformtpanel

How to maximize a form in a Tpanel using delphi


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)


Solution

  • 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;