MDI 的问题,请大家帮个手^_^

Coolongxp 2005-03-24 10:19:24
在delphi里面

用mdi结构

怎么判断其中的某个子窗体已经被创建啊?

我用FindWindowEx()好像不行

请大家指点下
以下是代码,请大家看看那里错了
(MainForm是主窗体,TMDIChild是子窗体)
if FindWindowEx(MainForm.Handle,0,0,'no1')=0 then
begin
Child := TMDIChild.Create(Application);
Child.Caption := 'no1';
end
else
................
...全文
139 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
largewang 2005-03-24
  • 打赏
  • 举报
回复
遍历Screen.Form对象
Kshape 2005-03-24
  • 打赏
  • 举报
回复
http://search.csdn.net/Expert/topic/1043/1043828.xml?temp=.8110773
Kshape 2005-03-24
  • 打赏
  • 举报
回复
给你段代码:
if not Assigned(frmStorageMain) then
begin
frmStorageMain:=TfrmStorageMain.Create(Application);
frmStorageMain.Show;
end
else
frmStorageMain.WindowState:=wsMaximized;
Coolongxp 2005-03-24
  • 打赏
  • 举报
回复
先谢谢大家咯

只是我的各个子窗体的类是一样的
区别是他们的标题不同
Breakc0de 2005-03-24
  • 打赏
  • 举报
回复
begin
IF not Assigned(TMDIChild) then
TMDIChild:= TTMDIChild.Create(self)
else
TMDIChild.Show ;
end;
兵兵 2005-03-24
  • 打赏
  • 举报
回复
if Application.FindComponent('MDIChildFrm')=nil then
Application.CreateForm(TMDIChildFrm,MDIChildFrm);
MDIChildFrm.Caption:='nol';
Coolongxp 2005-03-24
  • 打赏
  • 举报
回复
自己顶下,期待大家的答案啊
Coolongxp 2005-03-24
  • 打赏
  • 举报
回复
谢谢各位

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧