注意,窗体模式非MDI模式,普通模式(windowstate:=fsNomal),所有打开得窗体均嵌入在同一个Panel里面!
打开程序得代码如下:
--------------------
case iNumber of
0 :begin
Frm_pro_manage :=TFrm_pro_manage.Create(self);
Frm_pro_manage.Parent :=self.Pnl_main;
Frm_pro_manage.Show;
end;
1 :begin
Frm_archives :=TFrm_archives.Create(self);
Frm_archives.Parent :=self.Pnl_main;
Frm_archives.Show;
end;
2 :begin
Frm_budget :=TFrm_budget.Create(self);
Frm_budget.Parent :=self.Pnl_main;
Frm_budget.Show;
end;
-------------------
我想把上面所有打开得窗体用一个按钮一次性关闭!
打开程序得代码如下:
--------------------
case iNumber of
0 :begin
Frm_pro_manage :=TFrm_pro_manage.Create(self);
Frm_pro_manage.Parent :=self.Pnl_main;
Frm_pro_manage.Show;
end;
1 :begin
Frm_archives :=TFrm_archives.Create(self);
Frm_archives.Parent :=self.Pnl_main;
Frm_archives.Show;
end;
2 :begin
Frm_budget :=TFrm_budget.Create(self);
Frm_budget.Parent :=self.Pnl_main;
Frm_budget.Show;
end;
-------------------
我想把上面所有打开得窗体用一个按钮一次性关闭!
解决方案 »
- delphi 中如何判断子窗口是否已打开
- 学习delphi开发多层结构时的疑问
- 关于应用服务器更新的问题!!!
- 定义菜单事件时出现cannot find implementation of method
- 结构化存储问题,请帮忙看看。
- 如何运行一个控制台程序时不显示DOS窗口???
- delphi,再次提问,只求一个正确答案:一个初学者关于编译程序时的错误:Class TimageEx not found.
- 有用过xlswrite的朋友吗?请介绍一下它的用法,或提供帮助文档好吗?谢谢
- 我想做一个窗体,当打开它时,像碎片集中起来一样,当关闭他时,像碎片分解一样,高手们怎么办啊?
- 关于DataSet返回当前行的问题
- 怎么把下列类型转换成string类型?
- 如何通过api,shellexcute函数来察看文件属性
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
Memo1.Lines.Clear;
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
if (GetWindowText(hCurrentWindow, @szText, 255)>0) and isWindowVisible(hCurrentWindow) then
Memo1.Lines.Add(StrPas(@szText));
hCurrentWindow:=GetWindow(hCurrentWindow, GW_HWNDNEXT);
end;
end;
Procedure FreeForm;
var i:integer;
begin
i:=0;
while (i<Panel1.ComponentCount) and (Panel1.ComponentCount>0) do
if Panel1.Components[i] is TForm then
begin
Panel1.Components[i].Free;
i:=0;
end else Inc(i);
end;