procedure openform(Formclass:tformclass; var fm;aowner:tcomponent); var i:integer; child:tform; begin for i:=0 to screen.formcount -1 do if screen.Forms[i].classtype=formclass then begin child:=screen.Forms[i]; if child.windowstate=wsminimized then showwindow(child.handle,sw_shownormal) else showwindow(child.handle,sw_showna); if (not child.visible) then child.visible:=true; child.bringtofront; child.setfocus; Tform(fm):=child; exit; end; child:=tform(formclass.newinstance); tform(fm):=child; child.create(aowner); end;调用方法:openform(Tf_form1,f_form1,self); 你在指定时间内用这个方法就OK啦
var
i:integer;
child:tform;
begin
for i:=0 to screen.formcount -1 do
if screen.Forms[i].classtype=formclass then
begin
child:=screen.Forms[i];
if child.windowstate=wsminimized then
showwindow(child.handle,sw_shownormal)
else
showwindow(child.handle,sw_showna);
if (not child.visible) then child.visible:=true;
child.bringtofront;
child.setfocus;
Tform(fm):=child;
exit;
end;
child:=tform(formclass.newinstance);
tform(fm):=child;
child.create(aowner);
end;调用方法:openform(Tf_form1,f_form1,self);
你在指定时间内用这个方法就OK啦
因为我启动的时候会创建一个用户对象
然后创建我的主窗体
根据你的登陆信息创建用户对象
用户对象都有初始化界面的功能
因为不同权限的对象看到的界面是不一样的我希望尽量不需要APPLICATION去创建我的MDI窗体
而是我自己创建
楼上不知道你自己试过没有
如果不用APPLICATION创建这个MDI
屏幕闪了一下就没了主窗体不会出来的
开始的时候一个子窗体都没有