ct TMemo/TEdit/TButton, .
, , , ct - TClass, TButton/etc. TButton, true.
Delphi. as/is ClassType. .
:
procedure setCtrlState(objs: array of TObject; bState: boolean = True);
var
obj: TObject;
begin
for obj in objs do
begin
if (obj is TMemo) then
TMemo(obj).ReadOnly := not bState;
if (obj is TEdit) then
TEdit(obj).ReadOnly := not bState;
if (obj is TButton) then
TButton(obj).Enabled := bState;
end;
end;