O
openheart
Unregistered / Unconfirmed
GUEST, unregistred user!
我想编一个最简单的mdi程序,主窗体上3个菜单项,
对应打开3个子窗口.
主窗体
uses childcl,childcx;
procedure Tmainform.createMDIChildcl(const name:string);
var
child:Tchild_cl;
begin
child:=Tchild_cl.create(application);
child.caption:=name;
end;
procedure Tmainform.culiClick(Sender: TObject);
begin
createMDIChildcl('数据处理');
end;
子窗口
uses main,childcx;
procedure Tchild_cl.formclose(Sender: TObject;var action:Tcloseaction);
begin
action:=cafree;
end;
procedure Tchild_cl.exitClick(Sender: TObject);
begin
close;
end;
procedure Tchild_cl.mapClick(Sender: TObject);
begin
mainform.mapClick(Sender);
end;
但运行时,点culi进入child_cl子窗口后关不了子窗口,并且也打不开其他子窗口.
对应打开3个子窗口.
主窗体
uses childcl,childcx;
procedure Tmainform.createMDIChildcl(const name:string);
var
child:Tchild_cl;
begin
child:=Tchild_cl.create(application);
child.caption:=name;
end;
procedure Tmainform.culiClick(Sender: TObject);
begin
createMDIChildcl('数据处理');
end;
子窗口
uses main,childcx;
procedure Tchild_cl.formclose(Sender: TObject;var action:Tcloseaction);
begin
action:=cafree;
end;
procedure Tchild_cl.exitClick(Sender: TObject);
begin
close;
end;
procedure Tchild_cl.mapClick(Sender: TObject);
begin
mainform.mapClick(Sender);
end;
但运行时,点culi进入child_cl子窗口后关不了子窗口,并且也打不开其他子窗口.