//第一种方式 procedure TForm1.btn1Click(Sender: TObject); begin With TForm2.Create(Application) do Try ShowModal; finally free; end; end; //第二种方式 procedure TForm1.btn2Click(Sender: TObject); begin if not assigned(Form2) then begin Form2:=TForm2.Create(nil
{动态添加导航} var Panl:Tpanel; MainPage,Subpage:TPageControl; TabSheet1: TTabSheet; ToolBar2: TToolBar; Splitter:TSplitter; begin {创建导航树开始} Panl:=Tpanel.Create(self); with Panl do begin Parent := mainForm; Left:= ; Top:= ; Width:= ; Height:= ; Align:= alL