¿Cómo puedo hacer que mi código funcione? :) He tratado de formular esta pregunta, pero después de varios intentos fallidos, creo que ustedes detectarán el problema más rápido mirando el código que leyendo mis 'explicaciones'. gracias.lanzan TObject usando su ClassType?
setCtrlState([ memo1, edit1, button1], False);
_
procedure setCtrlState(objs: array of TObject; bState: boolean = True);
var
obj: TObject;
ct: TClass;
begin
for obj in objs do
begin
ct := obj.ClassType;
if (ct = TMemo) or (ct = TEdit) then
ct(obj).ReadOnly := not bState; // error here :(
if ct = TButton then
ct(obj).Enabled:= bState; // and here :(
end;
end;
esto es * exactamente * lo que estaba buscando. ¡Gracias! –