我的程序原来用的是form,在单击菜单时先判断这个form是否已经存在
if not FormExists('frmQrymnl') then
frame := TfrmQrymnl.Create(Self);
//以下是函数
FUNCTION FormExists(FORM_NAME:STRING):BOOLEAN;
BEGIN
IF application.FindComponent(FORM_NAME)=nil then
RESULT := FALSE
ELSE
RESULT := TRUE;
END;
现在我的程序为了不弹出窗口(客户要求),改用frame,但是问题来了,FormExists('frmQrymnl')
不再有效了,判断不了这个frame是否已经存在,我改怎么判断一个frame是否已经存在呢?谢谢高手帮忙!
if not FormExists('frmQrymnl') then
frame := TfrmQrymnl.Create(Self);
//以下是函数
FUNCTION FormExists(FORM_NAME:STRING):BOOLEAN;
BEGIN
IF application.FindComponent(FORM_NAME)=nil then
RESULT := FALSE
ELSE
RESULT := TRUE;
END;
现在我的程序为了不弹出窗口(客户要求),改用frame,但是问题来了,FormExists('frmQrymnl')
不再有效了,判断不了这个frame是否已经存在,我改怎么判断一个frame是否已经存在呢?谢谢高手帮忙!
谢谢高手们了!
查找窗体类名是否存在.
、、、、
怎么找?
用哪个方法?给个提示行不?谢谢了
has := false;
for i:=0 to 9 do begin
if captions[i]='模拟量查询' then begin
has := true;
break;
end;
end;
if(has = false) then begin
frame := TfrmQrymnl.Create(Self);
captions[0] := '模拟量查询';
end; frame.Parent := panelMain;
但是,问题来了,当我打开一次后,第二次(已经被另一个frame占用了frame1.Parent := panelMain)就不能显示frame了,为什么?请指教!