H
Harold
Unregistered / Unconfirmed
GUEST, unregistred user!
主form有scroll,子form的Parent设为主form的scroll
子form的一些属性如下:
BorderStyle := bsnone;
Parent := scrollbox1;
Align:=alclient;
position:=podefault;
主form有一函数调用
setcurrentform(TFcjname);{TFcjname为子form的name}
在实行中靠setcurrentform来关闭子form,如何用子form的
自己来关闭自己?Fcjname.close,Fcjname.release都出错。
附:setcurrentform函数:
procedure TFMainForm.SetCurrentForm(AFormClass : TFormClass);
begin
if(FCurrentForm = Nil) or (FCurrentForm.ClassType <> AFormClass) then
begin
if(FCurrentForm <> Nil) then
begin
if messagedlg('有数据窗体,继续?',mtconfirmation,[mbYes,mbNo],0)=mrYes
then
begin
FCurrentForm.release;{用函数来关闭子form}
Application.CreateForm(AFormClass, FCurrentForm);
panel5.Caption := FCurrentForm.Caption;
FCurrentForm.BorderStyle := bsnone;
FCurrentForm.Parent := scrollbox1;
FCurrentForm.Align := alclient;
FCurrentForm.position:=podefault;
FCurrentForm.Show;
end
else
begin
end
end
else
begin
Application.CreateForm(AFormClass, FCurrentForm);
panel5.Caption := FCurrentForm.Caption;
FCurrentForm.BorderStyle := bsnone;
FCurrentForm.Parent := scrollbox1;
FCurrentForm.Align := alclient;
FCurrentForm.position:=podefault;
FCurrentForm.Show;
end;
end;
end;
子form的一些属性如下:
BorderStyle := bsnone;
Parent := scrollbox1;
Align:=alclient;
position:=podefault;
主form有一函数调用
setcurrentform(TFcjname);{TFcjname为子form的name}
在实行中靠setcurrentform来关闭子form,如何用子form的
自己来关闭自己?Fcjname.close,Fcjname.release都出错。
附:setcurrentform函数:
procedure TFMainForm.SetCurrentForm(AFormClass : TFormClass);
begin
if(FCurrentForm = Nil) or (FCurrentForm.ClassType <> AFormClass) then
begin
if(FCurrentForm <> Nil) then
begin
if messagedlg('有数据窗体,继续?',mtconfirmation,[mbYes,mbNo],0)=mrYes
then
begin
FCurrentForm.release;{用函数来关闭子form}
Application.CreateForm(AFormClass, FCurrentForm);
panel5.Caption := FCurrentForm.Caption;
FCurrentForm.BorderStyle := bsnone;
FCurrentForm.Parent := scrollbox1;
FCurrentForm.Align := alclient;
FCurrentForm.position:=podefault;
FCurrentForm.Show;
end
else
begin
end
end
else
begin
Application.CreateForm(AFormClass, FCurrentForm);
panel5.Caption := FCurrentForm.Caption;
FCurrentForm.BorderStyle := bsnone;
FCurrentForm.Parent := scrollbox1;
FCurrentForm.Align := alclient;
FCurrentForm.position:=podefault;
FCurrentForm.Show;
end;
end;
end;