unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
ShowForm2Button: TButton;
procedure ShowForm2ButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.ShowForm2ButtonClick(Sender: TObject);
var
Form2: TForm;
begin
Form2 := TForm.Create(Self);
with Form2 do
begin
Parent := Form1.Panel1;
Align := alLeft;
Color := clBlue;
Height := Form1.Panel1.ClientHeight;
Width := Form1.Panel1.ClientWidth;
end;
Form2.Show;
end;
end.