MDI中父窗口与了窗口(100分)

  • 主题发起人 kevinzhao
  • 开始时间
K

kevinzhao

Unregistered / Unconfirmed
GUEST, unregistred user!
我不想用向导建立mdi程序,但建两 个窗体,一个属性设为fsMDIForm,另一个设为fsMDIChild,怎样让程序运行时,子窗口不出现,点关闭时为会么不会关闭,相反却是最小化,拜托
 
fsMDIChild 类里面的 OnClose 事件里面加上 Action := caMinimize
 
1、在菜单Project->Options->Forms 中将子窗体设置为Available forms
2、在子窗体的OnClose事件中,写入下面代码:
Action:=caFree;
子窗体如:Form1:=nil;

 
新建一个工程,两个窗体Form1、Form2,Form2为子窗体,在Form2的OnClose中写如下代码:
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
Form2:=nil;
end;
 
要在运行时不出现子窗口的话就要按F8在工程代码中把
Application.CreateForm(TForm1, Form1);//就是你的子窗口屏蔽掉

要调用子窗口的时候要写上:Application.CreateForm(TForm1, Form1);
就可以了
 
我的信箱是xinhe_1981@163.com有兴趣的话一起来探讨delphi
 
多人接受答案了。
 

Similar threads

回复
0
查看
690
不得闲
S
回复
0
查看
764
SUNSTONE的Delphi笔记
S
S
回复
0
查看
646
SUNSTONE的Delphi笔记
S
顶部