if not assigned(f) then
f:=tinsertform.create(application);
释放f时用f.Release ;f:= nil ;(加到f的关闭事件中)
f:=tinsertform.create(application);
释放f时用f.Release ;f:= nil ;(加到f的关闭事件中)
解决方案 »
- 国庆散分,大家都happy哈
- 如何用DELPHI 写一个服务 用来从 数据库A中提取数据到B 数据库
- sql问题:已知道一日期,如何在记录中查询给日期所在范围内的记录。
- 如何备份和导入SQL SERVER数据库~~~~~只要答的满意,会给红包地~~~~~~~~~
- 请问如何在文件流中搜索关键字,如使用TFileStream打开一个文件,想在这个中搜索1234,并且指针也移运到这里。如何做呢?代码如下,请指
- 急!!!DBGrid中怎么可以设置每栏的高度???
- 关于timer的简单问题
- 应如何收邮件?
- 有人用过Gifimage吗?
- 第一次到贵地,请教一个问题
- 怎样在delphi5中注册一个类?
- 有Delphi6正版的同志帮忙找一下这个文件-proxies.pas?
添加一个函数
IsExistWindow(FormClass:TComponentClass): Boolean
var
iIndex: Integer;
begin
Result := False;
for iIndex := 0 to MDIChildCount do begin
if MDIChildren[iIndex] is FormClass then begin
Result := True;
Exit;
end;
end;
end;然后在子窗体创建方法中,调用IsExistWindow函数来判断是否已经有相同类型的子窗体存在
如:
procedure TForm1.Button1Click(Sender: TObject);
f:tinsertform;
begin
if not IsExistWindow(tinsertform) then begin
f:=tinsertform.create(application);
f.Show;
end;
end;另:f:=tinsertform.create(application);
和
f:=tinsertform.create(self);有什么区别?
Create中的参数是宿主。表示由谁来对负责对新创建的Component的释放