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 ;
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;
如管理员进,则 Panel.Enable := True
否则 Panel.Enable := False
if (Components[i] is TEdit) then
TEdit(Components[i]).ReadOnly := True;
if (Components[i] is TComBoBox) then
TComboBox(Components[i]).Enabled:= False;
end ;
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;