标签:
procedure TForm1.Open_Tab_Form(ClassType:TComponentClass;OpenFrom:TForm);
var ThePanel:Tpanel;
Tabsheet1: TTabSheet;
begin
//动态创建tabsheet和panel
TabSheet1 := TTabSheet.Create(Self);
TabSheet1.PageControl := PageControl1;
ThePanel:=Tpanel.Create(self);
ThePanel.Parent:= TabSheet1;
ThePanel.Align:=alClient;
//ThePanel.DockSite:=true; // 将ThePanel.DockSite:=true则出现关闭条
//载入一个窗体到TAbsheet
application.CreateForm(ClassType,OpenFrom);
OpenFrom.Dock(ThePanel,BoundsRect);
OpenFrom.show;
TabSheet1.Caption:=OpenFrom.Caption;
TabSheet1.Show;
end;
标签:
原文地址:http://www.cnblogs.com/vov5601/p/4640779.html