procedure TForm2.ShowFrame(FrameNo:Integer);
var
i: integer;
begin
if (UserType<>'管理员') and (FrameNo<>3) then
begin
messagebox(handle,'没有足够的权限!','权限不足',MB_ICONWARNING+mb_ok);
exit;
end;
{清除所有的Frame}
for i:=0 to self.ComponentCount-1 do
if (self.Components[i] is Tframe) then (self.Components[i] as Tframe).Free;
{建立相应的Frame}
case FrameNo of
1:
begin
with TFrameUserList.Create(self) do
begin
Parent := Form2;
Left := 212;
Top := 174;
ADOQuery1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DataFile+';Persist Security Info=False';
ADOQuery1.Active := True;
Show;
end;
end;
2:
begin
with TFramecustomer.Create(self) do
begin
Parent := Form2;
Left :=212;
Top := 174;
ADOQuery1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DataFile+';Persist Security Info=False';
ADOQuery1.Active := True;
Show;
end;
end;。。。。。。
6:
begin
with TForm3.Create(self) do
begin
Parent := Form2;
Left := 212;
Top := 174;
//ADOQuery1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+DataFile+';Persist Security Info=False';
// ADOQuery1.Active := True;
Show;
end;
end;
end;
end;
可是为什么我调用
ShowFrame(3);其他的时候,背景上怎么还有TForm3啊
我不是写了{清除所有的Frame}
for i:=0 to self.ComponentCount-1 do
if (self.Components[i] is Tframe) then (self.Components[i] as Tframe).Free;