从我的代码里抄了一段你看看
procedure TF_sbdllr.FormCreate(Sender: TObject);
var
i: Integer;
begin
for i := 0 to - 1 do
begin
if ([i] is TDBEdit) then
begin
([i] as TDBEdit).enabled := false;
end;
if ([i] is TRzDBComboBox) then
begin
([i] as TRzDBComboBox).enabled := false;
([i] as TRzDBComboBox).Items.Add('甲班');
([i] as TRzDBComboBox).Items.Add('已班');
([i] as TRzDBComboBox).Items.Add('丙班');
end;
if [i] is TRzTabSheet then
begin
([i] as TRzTabSheet).tabVisible := false;
end;
end;
if (gsUserName = '张三')
then
begin
for i := 0 to - 1 do
begin
if [i] is TRzTabSheet then
begin
if (([i] as TRzTabSheet).Caption = '包封') then
begin
([i] as TRzTabSheet).tabVisible := True;
end;
end;
end;
end;
end;