M
mazheng
Unregistered / Unconfirmed
GUEST, unregistred user!
如代码,有时会出现这样的错误“name ont unique in this context” 如何处理〉??
//==============================================================================
procedure TmainFrm.N2Click(Sender: TObject);
var
newFrm: TDbmaterialFrm;
i,flag:integer;
begin
flag:=0;
for i:=0 to mainFrm.MDIChildCount do
begin
if mainFrm.MDIChildren.Caption='总物料管理' then
begin
SendMessage(mdichildren.Handle, WM_SYSCOMMAND, SC_restore, 0);
mdichildren.Show;
mdichildren.Enabled:=true;
flag:=1;
break;
end;
end;
if flag=0 then
begin
newFrm:=TDbmaterialFrm.Create(Application);
newFrm.Caption:='总物料管理';
end;
end;
//==============================================================================
procedure TmainFrm.N3Click(Sender: TObject);
var
//CalendarFrm: TCalendarFrm;
newFrm: TRomFrm;
i,flag:integer;
begin
flag:=0;
for i:=1 to mainFrm.MDIChildCount do
begin
if mainFrm.MDIChildren.Caption='物料清单' then
begin
SendMessage(mdichildren.Handle, WM_SYSCOMMAND, SC_restore, 0);
mdichildren.Show;
mdichildren.Enabled:=true;
flag:=1;
break;
end;
end;
//若窗体不存在,则创建窗体
if flag=0 then
begin
newFrm:=TRomFrm.Create(Application);
newFrm.Caption:='物料清单';
end;
end;
//==============================================================================
procedure TmainFrm.N2Click(Sender: TObject);
var
newFrm: TDbmaterialFrm;
i,flag:integer;
begin
flag:=0;
for i:=0 to mainFrm.MDIChildCount do
begin
if mainFrm.MDIChildren.Caption='总物料管理' then
begin
SendMessage(mdichildren.Handle, WM_SYSCOMMAND, SC_restore, 0);
mdichildren.Show;
mdichildren.Enabled:=true;
flag:=1;
break;
end;
end;
if flag=0 then
begin
newFrm:=TDbmaterialFrm.Create(Application);
newFrm.Caption:='总物料管理';
end;
end;
//==============================================================================
procedure TmainFrm.N3Click(Sender: TObject);
var
//CalendarFrm: TCalendarFrm;
newFrm: TRomFrm;
i,flag:integer;
begin
flag:=0;
for i:=1 to mainFrm.MDIChildCount do
begin
if mainFrm.MDIChildren.Caption='物料清单' then
begin
SendMessage(mdichildren.Handle, WM_SYSCOMMAND, SC_restore, 0);
mdichildren.Show;
mdichildren.Enabled:=true;
flag:=1;
break;
end;
end;
//若窗体不存在,则创建窗体
if flag=0 then
begin
newFrm:=TRomFrm.Create(Application);
newFrm.Caption:='物料清单';
end;
end;