看偶的:
var
tempsender:Tobject
(用不用它好象无所谓,懒得改了)
function TFrmMain.mycreateform(senderclass :TcomponentClass
sender:tobject):boolean;
begin
try
if not assigned(sender)then
begin
if tempsender <> sender then (tempsender as tform).close;
application.createform(senderclass,sender);
tempsender :=sender;
end;
(sender as tform).parent :=panelmain
//
(sender as tform).BorderIcons :=[];
(sender as tform).Align :=alclient;
(sender as tform).BorderStyle := bsNone;
(sender as tform).Font.name :='宋体';
(sender as tform).Font.Size :=9;
(sender as tform).show;
mycreateform:=true;
except
mycreateform:=false;
end;
end;
懒得用frame,就一直用这个代替了,呵呵