可以考虑设立一个窗体使用权限表,但如何在系统增减窗体时可以把子窗体自动录入窗体使用权限表,以及录入子窗体的哪些属性呢?关键是在创建子窗体时如何对应?代码: for i:=0 to MDIChildcount-1 do begin if MDIChildren[i] is TForm_read_chaobiao_card_all then begin MDIChildren[i].Show; MDIChildren[i].windowstate:=wsNormal; Exit; end; end; OldCursor:=Screen.Cursor; Screen.Cursor:=crHourglass; try Form_read_chaobiao_card_all:=TForm_read_chaobiao_card_all.Create(Application); finally Screen.Cursor:=OldCursor; end;
不同的用户中将各个不同的窗体的ENABLED进行设置
begin
if MDIChildren[i] is TForm_read_chaobiao_card_all then
begin
MDIChildren[i].Show;
MDIChildren[i].windowstate:=wsNormal;
Exit;
end;
end;
OldCursor:=Screen.Cursor;
Screen.Cursor:=crHourglass;
try
Form_read_chaobiao_card_all:=TForm_read_chaobiao_card_all.Create(Application);
finally
Screen.Cursor:=OldCursor;
end;