Oussaki
Oussaki

Reputation: 1649

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)

Upvotes: 0

Views: 1100

Answers (1)

David Heffernan
David Heffernan

Reputation: 612954

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;

Upvotes: 4

Related Questions