如题,谢谢。

解决方案 »

  1.   

    把这些控件放在一个Panel中,
    如管理员进,则 Panel.Enable := True
    否则 Panel.Enable := False
      

  2.   

    For i:=0 to ComponentCount-1 do  begin
                if (Components[i] is TEdit) then
                    TEdit(Components[i]).ReadOnly  := True;
                if (Components[i] is TComBoBox) then
                    TComboBox(Components[i]).Enabled:= False;
             end ;
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      I:integer;
    begin
      For i:=0 to ComponentCount-1 Do begin
        if Components[i] is TEdit then (Components[i]as TEdit).ReadOnly:=true;
        if Components[i] is Tcombobox then (Components[i]as Tcombobox).Enabled:=false;
      end;
    end;